summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-22 15:06:17 -0700
committerBrian Paul <brianp@vmware.com>2009-01-22 15:06:17 -0700
commit06f3b2e6799ebd66a813ce9345c2ca6bbd0abe7d (patch)
tree47c05f8e81678cad894f497a1a8b78f308be6633 /src
parent989edea40913de9347908488db8978eb2efaba63 (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().
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/fbobject.c10
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) {