diff options
author | Brian Paul <brianp@vmware.com> | 2009-01-19 15:45:08 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-19 15:45:08 -0700 |
commit | e43123ee6fd9846509b94e542123abaa03ed1249 (patch) | |
tree | 3b4a4c8bb9773fd1a9e65feff060a9389085836d | |
parent | c84f557b47a25725da5ac6b22face481e2ce38cd (diff) |
mesa: additional FBO/RB id error checking for ARB_fbo
It's illegal to bind a FBO/RB id that didn't come from glGenRender/Framebuffer().
-rw-r--r-- | src/mesa/main/fbobject.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index faf3763b71..f904937078 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -616,6 +616,11 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) newRb = NULL; } if (!newRb) { + if (ctx->Extensions.ARB_framebuffer_object) { + /* All RB IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); + return; + } /* create new renderbuffer object */ newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); if (!newRb) { @@ -1018,6 +1023,11 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) newFb = NULL; } if (!newFb) { + if (ctx->Extensions.ARB_framebuffer_object) { + /* All FBO IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); + return; + } /* create new framebuffer object */ newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); if (!newFb) { |