Bug 1316486 - BindRenderbuffer should return invalid operation with a deleted render buffer input, r?mtseng
MozReview-Commit-ID: Gu976wWy352
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -165,19 +165,19 @@ WebGLContext::BindRenderbuffer(GLenum ta
return;
if (target != LOCAL_GL_RENDERBUFFER)
return ErrorInvalidEnumInfo("bindRenderbuffer: target", target);
if (!ValidateObjectAllowDeletedOrNull("bindRenderbuffer", wrb))
return;
- // silently ignore a deleted buffer
- if (wrb && wrb->IsDeleted())
- return;
+ if (wrb && wrb->IsDeleted()) {
+ return ErrorInvalidOperation("BindRenderbuffer: bind a deleted buffer");
+ }
// Usually, we would now call into glBindRenderbuffer. However, since we have to
// potentially emulate packed-depth-stencil, there's not a specific renderbuffer that
// we know we should bind here.
// Instead, we do all renderbuffer binding lazily.
if (wrb) {
wrb->mHasBeenBound = true;