Changeset 210945 in webkit


Ignore:
Timestamp:
Jan 19, 2017 5:09:20 PM (7 years ago)
Author:
jer.noble@apple.com
Message:

CRASH at WebCore::TrackListBase::remove
https://bugs.webkit.org/show_bug.cgi?id=167217

Reviewed by Brent Fulgham.

Source/WebCore:

Test: media/media-source/media-source-error-crash.html

In very specific conditions, a HTMLMediaElement backed by a MediaSource can try to remove
the same track from its track list twice. If there are two SourceBuffers attached to a
HTMLMediaElement, and one has not yet been initialized, when the second fails to parse an
appended buffer after receiving an initialization segment, the HTMLMediaElement will remove
all its tracks in mediaLoadingFailed(), then MediaSource object itself will attempt remove
the same track in removeSourceBuffer().

Solving this the safest way possible: bail early from TrackListBase if asked to remove a
track which the list does not contain.

  • html/track/TrackListBase.cpp:

(TrackListBase::remove):

LayoutTests:

  • media/media-source/media-source-error-crash-expected.txt: Added.
  • media/media-source/media-source-error-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r210941 r210945  
     12017-01-19  Jer Noble  <jer.noble@apple.com>
     2
     3        CRASH at WebCore::TrackListBase::remove
     4        https://bugs.webkit.org/show_bug.cgi?id=167217
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * media/media-source/media-source-error-crash-expected.txt: Added.
     9        * media/media-source/media-source-error-crash.html: Added.
     10
    1112017-01-19  Megan Gardner  <megan_gardner@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r210943 r210945  
     12017-01-19  Jer Noble  <jer.noble@apple.com>
     2
     3        CRASH at WebCore::TrackListBase::remove
     4        https://bugs.webkit.org/show_bug.cgi?id=167217
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Test: media/media-source/media-source-error-crash.html
     9
     10        In very specific conditions, a HTMLMediaElement backed by a MediaSource can try to remove
     11        the same track from its track list twice. If there are two SourceBuffers attached to a
     12        HTMLMediaElement, and one has not yet been initialized, when the second fails to parse an
     13        appended buffer after receiving an initialization segment, the HTMLMediaElement will remove
     14        all its tracks in mediaLoadingFailed(), then MediaSource object itself will attempt remove
     15        the same track in removeSourceBuffer().
     16
     17        Solving this the safest way possible: bail early from TrackListBase if asked to remove a
     18        track which the list does not contain.
     19
     20        * html/track/TrackListBase.cpp:
     21        (TrackListBase::remove):
     22
    1232017-01-19  Andy Estes  <aestes@apple.com>
    224
  • trunk/Source/WebCore/html/track/TrackListBase.cpp

    r206127 r210945  
    7272{
    7373    size_t index = m_inbandTracks.find(&track);
    74     ASSERT(index != notFound);
     74    if (index == notFound)
     75        return;
    7576
    7677    if (track.mediaElement()) {
Note: See TracChangeset for help on using the changeset viewer.