Title: [295170] trunk/Source
Revision
295170
Author
[email protected]
Date
2022-06-02 22:35:30 -0700 (Thu, 02 Jun 2022)

Log Message

Add check for pixel buffer format in RemoteRenderingBackend::getPixelBufferForImageBuffer
https://bugs.webkit.org/show_bug.cgi?id=241243
<rdar://89611041>

Reviewed by Simon Fraser.

Add check to ensure that pixel buffer format is supported.

* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::getPixelBufferForImageBuffer):

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/PixelBuffer.h (295169 => 295170)


--- trunk/Source/WebCore/platform/graphics/PixelBuffer.h	2022-06-03 05:31:49 UTC (rev 295169)
+++ trunk/Source/WebCore/platform/graphics/PixelBuffer.h	2022-06-03 05:35:30 UTC (rev 295170)
@@ -39,7 +39,7 @@
 class PixelBuffer : public RefCounted<PixelBuffer> {
     WTF_MAKE_NONCOPYABLE(PixelBuffer);
 public:
-    static bool supportedPixelFormat(PixelFormat);
+    WEBCORE_EXPORT static bool supportedPixelFormat(PixelFormat);
 
     WEBCORE_EXPORT static RefPtr<PixelBuffer> tryCreate(const PixelBufferFormat&, const IntSize&);
     WEBCORE_EXPORT static RefPtr<PixelBuffer> tryCreate(const PixelBufferFormat&, const IntSize&, Ref<JSC::ArrayBuffer>&&);

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (295169 => 295170)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-06-03 05:31:49 UTC (rev 295169)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-06-03 05:35:30 UTC (rev 295170)
@@ -207,6 +207,7 @@
 void RemoteRenderingBackend::getPixelBufferForImageBuffer(RenderingResourceIdentifier imageBuffer, PixelBufferFormat&& destinationFormat, IntRect&& srcRect, CompletionHandler<void()>&& completionHandler)
 {
     MESSAGE_CHECK(m_getPixelBufferSharedMemory, "No shared memory for getPixelBufferForImageBuffer");
+    MESSAGE_CHECK(PixelBuffer::supportedPixelFormat(destinationFormat.pixelFormat), "Pixel format not supported");
     QualifiedRenderingResourceIdentifier qualifiedImageBuffer { imageBuffer, m_gpuConnectionToWebProcess->webProcessIdentifier() };
     if (auto imageBuffer = m_remoteResourceCache.cachedImageBuffer(qualifiedImageBuffer)) {
         auto pixelBuffer = imageBuffer->getPixelBuffer(destinationFormat, srcRect);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to