Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2322943002: Generate INVALID_OPERATION error when attempting to bind a deleted object (Closed)
Patch Set: Solve merge conflict Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index ab219c980adc7321ac32500c5923f963a0279ce0..1113e5d4ab6c4b70651e21ca82343c625e1d59b7 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1520,8 +1520,10 @@ void WebGLRenderingContextBase::bindBuffer(GLenum target, WebGLBuffer* buffer)
bool deleted;
if (!checkObjectToBeBound("bindBuffer", buffer, deleted))
return;
- if (deleted)
- buffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindBuffer", "attempt to bind a deleted buffer");
+ return;
+ }
if (!validateAndUpdateBufferBindTarget("bindBuffer", target, buffer))
return;
@@ -1536,9 +1538,10 @@ void WebGLRenderingContextBase::bindFramebuffer(GLenum target, WebGLFramebuffer*
bool deleted;
if (!checkObjectToBeBound("bindFramebuffer", buffer, deleted))
return;
-
- if (deleted)
- buffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindFramebuffer", "attempt to bind a deleted framebuffer");
+ return;
+ }
if (target != GL_FRAMEBUFFER) {
synthesizeGLError(GL_INVALID_ENUM, "bindFramebuffer", "invalid target");
@@ -1553,8 +1556,10 @@ void WebGLRenderingContextBase::bindRenderbuffer(GLenum target, WebGLRenderbuffe
bool deleted;
if (!checkObjectToBeBound("bindRenderbuffer", renderBuffer, deleted))
return;
- if (deleted)
- renderBuffer = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindRenderbuffer", "attempt to bind a deleted renderbuffer");
+ return;
+ }
if (target != GL_RENDERBUFFER) {
synthesizeGLError(GL_INVALID_ENUM, "bindRenderbuffer", "invalid target");
return;
@@ -1573,8 +1578,10 @@ void WebGLRenderingContextBase::bindTexture(GLenum target, WebGLTexture* texture
bool deleted;
if (!checkObjectToBeBound("bindTexture", texture, deleted))
return;
- if (deleted)
- texture = 0;
+ if (deleted) {
+ synthesizeGLError(GL_INVALID_OPERATION, "bindTexture", "attempt to bind a deleted texture");
+ return;
+ }
if (texture && texture->getTarget() && texture->getTarget() != target) {
synthesizeGLError(GL_INVALID_OPERATION, "bindTexture", "textures can not be used with multiple targets");
return;
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698