Skip to content
Browse files
CVPixelBufferGetBytePointerCallback should check for CVPixelBufferGet…
…BaseAddress returning nullptr

Patch by Youenn Fablet <> 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:

Canonical link:
git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Jun 22, 2022
1 parent 273e6e9 commit 5c114d9
Showing 1 changed file with 6 additions and 0 deletions.
@@ -70,6 +70,12 @@ static const void* CVPixelBufferGetBytePointerCallback(void* refcon)

void* address = CVPixelBufferGetBaseAddress(info->pixelBuffer.get());
if (!address) {
RELEASE_LOG_ERROR(Media, "CVPixelBufferGetBaseAddress returned null");
return nullptr;

size_t byteLength = CVPixelBufferGetBytesPerRow(info->pixelBuffer.get()) * CVPixelBufferGetHeight(info->pixelBuffer.get());

verifyImageBufferIsBigEnough(address, byteLength);

0 comments on commit 5c114d9

Please sign in to comment.