[MSE] Removing samples when presentation order does not match decode order can cause...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 20:08:05 +0000 (20:08 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 20:08:05 +0000 (20:08 +0000)
commitf6ac4efaa10a52244f58d08a2d4eb8577251f883
treed5beb2bb65e36bf56dd59f7016b86a9595dca52f
parent1030f642269311184ecf922be335fbdbc4cefcb2
[MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
https://bugs.webkit.org/show_bug.cgi?id=174514

Reviewed by Sam Weinig.

Source/WebCore:

Test: media/media-source/media-source-remove-decodeorder-crash.html

Fix the algorithm in removeCodedFrames() so that it's not possible to have a removePresentationStart >
removePresentationEnd (and also removeDecodeStart > removeDecodeEnd).

* Modules/mediasource/SampleMap.cpp:
(WebCore::PresentationOrderSampleMap::findSampleContainingOrAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleStartingAfterPresentationTime):
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeCodedFrames):

Tools:

* TestWebKitAPI/Tests/WebCore/SampleMap.cpp:
(TestWebKitAPI::TEST_F):

LayoutTests:

* media/media-source/media-source-remove-decodeorder-crash-expected.txt: Added.
* media/media-source/media-source-remove-decodeorder-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-remove-decodeorder-crash-expected.txt [new file with mode: 0644]
LayoutTests/media/media-source/media-source-remove-decodeorder-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SampleMap.cpp
Source/WebCore/Modules/mediasource/SampleMap.h
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/SampleMap.cpp