Skip to content
Permalink
Browse files
Need to check the context wasn't lost in WebGL2RenderingContext::read…
…Buffer()

https://bugs.webkit.org/show_bug.cgi?id=241477
<rdar://94289317>

Patch by Antoine Quint <graouts@apple.com> 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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
graouts authored and webkit-commit-queue committed Jun 9, 2022
1 parent e7e584e commit 4c12dfbd4dccf9425167f3a727d2e5444b872127
Showing 1 changed file with 3 additions and 0 deletions.
@@ -811,6 +811,9 @@ void WebGL2RenderingContext::invalidateSubFramebuffer(GCGLenum target, const Vec

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) {

0 comments on commit 4c12dfb

Please sign in to comment.