Title: [295734] trunk/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp
Revision
295734
Author
[email protected]
Date
2022-06-22 10:11:51 -0700 (Wed, 22 Jun 2022)

Log Message

CVPixelBufferGetBytePointerCallback should check for CVPixelBufferGetBaseAddress returning nullptr
https://bugs.webkit.org/show_bug.cgi?id=241845
rdar://95622853

Patch by Youenn Fablet <[email protected]> on 2022-06-22
Reviewed by Eric Carlson.

CVPixelBufferGetBaseAddress may return nullptr in some cases.
In that case, return early.

* Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):

Canonical link: https://commits.webkit.org/251739@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp (295733 => 295734)


--- trunk/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp	2022-06-22 16:33:23 UTC (rev 295733)
+++ trunk/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp	2022-06-22 17:11:51 UTC (rev 295734)
@@ -70,6 +70,12 @@
 
     ++info->lockCount;
     void* address = CVPixelBufferGetBaseAddress(info->pixelBuffer.get());
+    if (!address) {
+        RELEASE_LOG_ERROR(Media, "CVPixelBufferGetBaseAddress returned null");
+        RELEASE_LOG_STACKTRACE(Media);
+        return nullptr;
+    }
+
     size_t byteLength = CVPixelBufferGetBytesPerRow(info->pixelBuffer.get()) * CVPixelBufferGetHeight(info->pixelBuffer.get());
 
     verifyImageBufferIsBigEnough(address, byteLength);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to