Title: [295430] trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Revision
295430
Author
[email protected]
Date
2022-06-09 12:26:54 -0700 (Thu, 09 Jun 2022)

Log Message

Need to check the context wasn't lost in WebGL2RenderingContext::readBuffer()
https://bugs.webkit.org/show_bug.cgi?id=241477
<rdar://94289317>

Patch by Antoine Quint <[email protected]> on 2022-06-09
Reviewed by Dean Jackson.

All other APIs exposed on WebGL2RenderingContext are guarded by isContextLostOrPending()
checks, and readBuffer() should be no exception.

* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::readBuffer):

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (295429 => 295430)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2022-06-09 19:25:08 UTC (rev 295429)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2022-06-09 19:26:54 UTC (rev 295430)
@@ -811,6 +811,9 @@
 
 void WebGL2RenderingContext::readBuffer(GCGLenum src)
 {
+    if (isContextLostOrPending())
+        return;
+
     if (src == GraphicsContextGL::BACK) {
         // Because the backbuffer is simulated on all current WebKit ports, we need to change BACK to COLOR_ATTACHMENT0.
         if (m_readFramebufferBinding) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to