diff options
author | Ian Romanick <[email protected]> | 2011-10-03 12:04:09 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-10-11 09:01:09 -0700 |
commit | da2e41cd88dd68b658534390ed69dd422172d07b (patch) | |
tree | f7517b7ffa42deb7e30d7a0dd5b5cd1f297f7bd7 /src/mesa/main | |
parent | a8328cc132e9edd55141e8e7822909a85bda12d6 (diff) |
mesa: Only allow queries of window system FBO on desktop GL w/ARB_fbo
Neither OES_framebuffer_object nor EXT_framebuffer_object allow
querying the window system FBO.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index e945f0b64e1..f9da54e73c0 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2276,6 +2276,21 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } if (is_winsys_fbo(buffer)) { + /* Page 126 (page 136 of the PDF) of the OpenGL ES 2.0.25 spec + * says: + * + * "If the framebuffer currently bound to target is zero, then + * INVALID_OPERATION is generated." + * + * The EXT_framebuffer_object spec has the same wording, and the + * OES_framebuffer_object spec refers to the EXT_framebuffer_object + * spec. + */ + if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetFramebufferAttachmentParameteriv(bound FBO = 0)"); + return; + } /* the default / window-system FBO */ att = _mesa_get_fb0_attachment(ctx, buffer, attachment); } |