Title: [149225] trunk/Source/WebCore
Revision
149225
Author
jer.no...@apple.com
Date
2013-04-26 17:17:53 -0700 (Fri, 26 Apr 2013)

Log Message

Nil-check the results of -[AVPlayerItemVideoOutput copyPixelBufferForItemTime:itemTimeForDisplay:].
https://bugs.webkit.org/show_bug.cgi?id=115265

Reviewed by Eric Carlson.

copyPixelBufferForItemTime:itemTimeForDisplay: can return nil, even
when hasNewPixelBufferForItemTime: returns YES. Check the results
before passing the buffer on to VTPixelTransferSessionTransferImage()
which does not NULL-check its parameters.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149224 => 149225)


--- trunk/Source/WebCore/ChangeLog	2013-04-27 00:09:55 UTC (rev 149224)
+++ trunk/Source/WebCore/ChangeLog	2013-04-27 00:17:53 UTC (rev 149225)
@@ -1,3 +1,18 @@
+2013-04-26  Jer Noble  <jer.no...@apple.com>
+
+        Nil-check the results of -[AVPlayerItemVideoOutput copyPixelBufferForItemTime:itemTimeForDisplay:].
+        https://bugs.webkit.org/show_bug.cgi?id=115265
+
+        Reviewed by Eric Carlson.
+
+        copyPixelBufferForItemTime:itemTimeForDisplay: can return nil, even
+        when hasNewPixelBufferForItemTime: returns YES. Check the results
+        before passing the buffer on to VTPixelTransferSessionTransferImage()
+        which does not NULL-check its parameters.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
+
 2013-04-26  Roger Fong  <roger_f...@apple.com>
 
         Uninflate caret rect.

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (149224 => 149225)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-04-27 00:09:55 UTC (rev 149224)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-04-27 00:17:53 UTC (rev 149225)
@@ -1125,6 +1125,8 @@
         return 0;
 
     RetainPtr<CVPixelBufferRef> buffer = adoptCF([m_videoOutput.get() copyPixelBufferForItemTime:currentTime itemTimeForDisplay:nil]);
+    if (!buffer)
+        return 0;
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     // Create a VTPixelTransferSession, if necessary, as we cannot guarantee timely delivery of ARGB pixels.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to