Title: [215579] trunk/Source/WebCore
- Revision
- 215579
- Author
- pvol...@apple.com
- Date
- 2017-04-20 14:42:55 -0700 (Thu, 20 Apr 2017)
Log Message
The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
https://bugs.webkit.org/show_bug.cgi?id=171063
Reviewed by Eric Carlson.
The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.
No new tests since the change is a sanity check.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekTask):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (215578 => 215579)
--- trunk/Source/WebCore/ChangeLog 2017-04-20 21:30:35 UTC (rev 215578)
+++ trunk/Source/WebCore/ChangeLog 2017-04-20 21:42:55 UTC (rev 215579)
@@ -1,3 +1,19 @@
+2017-04-20 Per Arne Vollan <pvol...@apple.com>
+
+ The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
+ https://bugs.webkit.org/show_bug.cgi?id=171063
+
+ Reviewed by Eric Carlson.
+
+ The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.
+
+ No new tests since the change is a sanity check.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seekTask):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
+
2017-04-20 Anders Carlsson <ander...@apple.com>
Replace isFinalStateStatus with isFinalStateResult
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (215578 => 215579)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-04-20 21:30:35 UTC (rev 215578)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2017-04-20 21:42:55 UTC (rev 215579)
@@ -2702,6 +2702,8 @@
MediaTime positiveTolerance = m_pendingSeek->positiveTolerance;
m_pendingSeek = nullptr;
+ ASSERT(negativeTolerance >= MediaTime::zeroTime());
+
// 6 - If the new playback position is later than the end of the media resource, then let it be the end
// of the media resource instead.
time = std::min(time, durationMediaTime());
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (215578 => 215579)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2017-04-20 21:30:35 UTC (rev 215578)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2017-04-20 21:42:55 UTC (rev 215579)
@@ -1395,6 +1395,10 @@
CMTime cmBefore = toCMTime(negativeTolerance);
CMTime cmAfter = toCMTime(positiveTolerance);
+ // [AVPlayerItem seekToTime] will throw an exception if toleranceBefore is negative.
+ if (CMTimeCompare(cmBefore, kCMTimeZero) < 0)
+ cmBefore = kCMTimeZero;
+
auto weakThis = createWeakPtr();
LOG(Media, "MediaPlayerPrivateAVFoundationObjC::seekToTime(%p) - calling seekToTime", this);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes