⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286327 in webkit


Ignore:
Timestamp:
Nov 30, 2021, 2:23:54 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

nullptr deref in InbandChapterTrackPrivateAVFObjC::processChapters
https://bugs.webkit.org/show_bug.cgi?id=233605

Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-11-30
Reviewed by Eric Carlson.

Source/WebCore:

The createChapterCue lambda gets dispatched onto the main thread. When it executes,
the client might no longer be valid, so we are adding a nullptr check at the start
of the lambda, as is done at the start of the method.

Test: media/track/track-in-band-chapters-invalid-client-crash.html

  • platform/graphics/avfoundation/objc/InbandChapterTrackPrivateAVFObjC.mm:

(WebCore::InbandChapterTrackPrivateAVFObjC::processChapters):

LayoutTests:

  • media/track/track-in-band-chapters-invalid-client-crash-expected.txt: Added.
  • media/track/track-in-band-chapters-invalid-client-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286325 r286327  
     12021-11-30  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        nullptr deref in InbandChapterTrackPrivateAVFObjC::processChapters
     4        https://bugs.webkit.org/show_bug.cgi?id=233605
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/track/track-in-band-chapters-invalid-client-crash-expected.txt: Added.
     9        * media/track/track-in-band-chapters-invalid-client-crash.html: Added.
     10
    1112021-11-30  Robert Jenner  <Jenner@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r286324 r286327  
     12021-11-30  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        nullptr deref in InbandChapterTrackPrivateAVFObjC::processChapters
     4        https://bugs.webkit.org/show_bug.cgi?id=233605
     5
     6        Reviewed by Eric Carlson.
     7
     8        The createChapterCue lambda gets dispatched onto the main thread. When it executes,
     9        the client might no longer be valid, so we are adding a nullptr check at the start
     10        of the lambda, as is done at the start of the method.
     11
     12        Test: media/track/track-in-band-chapters-invalid-client-crash.html
     13
     14        * platform/graphics/avfoundation/objc/InbandChapterTrackPrivateAVFObjC.mm:
     15        (WebCore::InbandChapterTrackPrivateAVFObjC::processChapters):
     16
    1172021-11-30  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandChapterTrackPrivateAVFObjC.mm

    r283217 r286327  
    5555    auto identifier = LOGIDENTIFIER;
    5656    auto createChapterCue = ([this, identifier] (AVMetadataItem *item, int chapterNumber) mutable {
     57        if (!client())
     58            return;
    5759        ChapterData chapterData = { PAL::toMediaTime([item time]), PAL::toMediaTime([item duration]), [item stringValue] };
    5860        if (m_processedChapters.contains(chapterData))
Note: See TracChangeset for help on using the changeset viewer.