⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295734 in webkit


Ignore:
Timestamp:
Jun 22, 2022, 10:11:51 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Youenn Fablet <youennf@gmail.com> 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp

    r293886 r295734  
    7171    ++info->lockCount;
    7272    void* address = CVPixelBufferGetBaseAddress(info->pixelBuffer.get());
     73    if (!address) {
     74        RELEASE_LOG_ERROR(Media, "CVPixelBufferGetBaseAddress returned null");
     75        RELEASE_LOG_STACKTRACE(Media);
     76        return nullptr;
     77    }
     78
    7379    size_t byteLength = CVPixelBufferGetBytesPerRow(info->pixelBuffer.get()) * CVPixelBufferGetHeight(info->pixelBuffer.get());
    7480
Note: See TracChangeset for help on using the changeset viewer.