diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index 1ba61c129630..4f8406752b65 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -340,6 +340,9 @@ void WebGLContext::FramebufferAttach(const GLenum target, } auto safeToAttach = toAttach; + if (!toAttach.rb && !toAttach.tex) { + safeToAttach = {}; + } if (!IsWebGL2() && !IsExtensionEnabled(WebGLExtensionID::OES_fbo_render_mipmap)) { safeToAttach.mipLevel = 0;