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

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: 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 f603d1fdf07ffd11519a415438f9903395773640..c98c8286cd72565935fe0604ef035889b130040a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1515,8 +1515,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;
@@ -1528,9 +1530,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");
@@ -1545,8 +1548,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, "bindBuffer", "attempt to bind a deleted renderbuffer");
qiankun 2016/09/08 09:01:00 typo: bindBuffer -> bindRenderbuffer
+ return;
+ }
if (target != GL_RENDERBUFFER) {
synthesizeGLError(GL_INVALID_ENUM, "bindRenderbuffer", "invalid target");
return;
@@ -1565,8 +1570,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