Diff
Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (241503 => 241504)
--- branches/safari-607-branch/Source/WebCore/ChangeLog 2019-02-14 08:34:24 UTC (rev 241503)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog 2019-02-14 08:34:27 UTC (rev 241504)
@@ -1,3 +1,36 @@
+2019-02-13 Babak Shafiei <[email protected]>
+
+ Cherry-pick r241437. rdar://problem/48065626
+
+ [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
+ https://bugs.webkit.org/show_bug.cgi?id=194580
+ <rdar://problem/42727739>
+
+ Reviewed by Eric Carlson.
+
+ * platform/cocoa/CoreVideoSoftLink.cpp:
+ * platform/cocoa/CoreVideoSoftLink.h:
+ * platform/graphics/cv/PixelBufferConformerCV.cpp:
+ (WebCore::CVPixelBufferGetBytePointerCallback):
+ (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-13 Jer Noble <[email protected]>
+
+ [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
+ https://bugs.webkit.org/show_bug.cgi?id=194580
+ <rdar://problem/42727739>
+
+ Reviewed by Eric Carlson.
+
+ * platform/cocoa/CoreVideoSoftLink.cpp:
+ * platform/cocoa/CoreVideoSoftLink.h:
+ * platform/graphics/cv/PixelBufferConformerCV.cpp:
+ (WebCore::CVPixelBufferGetBytePointerCallback):
+ (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
+
2019-02-13 Alan Coon <[email protected]>
Cherry-pick r241319. rdar://problem/48015672
Modified: branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp (241503 => 241504)
--- branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp 2019-02-14 08:34:24 UTC (rev 241503)
+++ branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp 2019-02-14 08:34:27 UTC (rev 241504)
@@ -41,7 +41,6 @@
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetBaseAddress, void*, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetBytesPerRow, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetBytesPerRowOfPlane, size_t, (CVPixelBufferRef pixelBuffer, size_t planeIndex), (pixelBuffer, planeIndex))
-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetDataSize, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetPixelFormatType, OSType, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetBaseAddressOfPlane, void *, (CVPixelBufferRef pixelBuffer, size_t planeIndex), (pixelBuffer, planeIndex));
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferLockBaseAddress, CVReturn, (CVPixelBufferRef pixelBuffer, CVOptionFlags lockFlags), (pixelBuffer, lockFlags))
Modified: branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h (241503 => 241504)
--- branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h 2019-02-14 08:34:24 UTC (rev 241503)
+++ branches/safari-607-branch/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h 2019-02-14 08:34:27 UTC (rev 241504)
@@ -48,8 +48,6 @@
#define CVPixelBufferGetBytesPerRow softLink_CoreVideo_CVPixelBufferGetBytesPerRow
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVPixelBufferGetBytesPerRowOfPlane, size_t, (CVPixelBufferRef pixelBuffer, size_t planeIndex), (pixelBuffer, planeIndex))
#define CVPixelBufferGetBytesPerRowOfPlane softLink_CoreVideo_CVPixelBufferGetBytesPerRowOfPlane
-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVPixelBufferGetDataSize, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
-#define CVPixelBufferGetDataSize softLink_CoreVideo_CVPixelBufferGetDataSize
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVPixelBufferGetPixelFormatType, OSType, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
#define CVPixelBufferGetPixelFormatType softLink_CoreVideo_CVPixelBufferGetPixelFormatType
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreVideo, CVPixelBufferGetBaseAddressOfPlane, void *, (CVPixelBufferRef pixelBuffer, size_t planeIndex), (pixelBuffer, planeIndex));
Modified: branches/safari-607-branch/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp (241503 => 241504)
--- branches/safari-607-branch/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp 2019-02-14 08:34:24 UTC (rev 241503)
+++ branches/safari-607-branch/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp 2019-02-14 08:34:27 UTC (rev 241504)
@@ -83,8 +83,10 @@
++info->lockCount;
void* address = CVPixelBufferGetBaseAddress(info->pixelBuffer.get());
- verifyImageBufferIsBigEnough(address, CVPixelBufferGetDataSize(info->pixelBuffer.get()));
- RELEASE_LOG_INFO(Media, "CVPixelBufferGetBytePointerCallback() returning bytePointer: %p, size: %zu", address, CVPixelBufferGetDataSize(info->pixelBuffer.get()));
+ size_t byteLength = CVPixelBufferGetBytesPerRow(info->pixelBuffer.get()) * CVPixelBufferGetHeight(info->pixelBuffer.get());
+
+ verifyImageBufferIsBigEnough(address, byteLength);
+ RELEASE_LOG_INFO(Media, "CVPixelBufferGetBytePointerCallback() returning bytePointer: %p, size: %zu", address, byteLength);
return address;
}
@@ -177,7 +179,7 @@
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaFirst;
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(buffer.get());
- size_t byteLength = CVPixelBufferGetDataSize(buffer.get());
+ size_t byteLength = bytesPerRow * height;
ASSERT(byteLength);
if (!byteLength)