summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-27 13:14:40 -0600
committerBrian Paul <brianp@vmware.com>2010-05-27 13:14:40 -0600
commit011e7b2c960263424f407326ae5eb91e7424d384 (patch)
tree635ea1c233730e36038d20d8a874941a826ee9c7
parent2eb5bc5add274634a536ce2094f877fd974d771f (diff)
mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially non-existant) current attachment. Fixes segfault w/ fbotexture -ds2. NOTE: this will be applied to the 7.8 branch too. (cherry picked from commit a504f2387e2bb47025c7406d9a466a042dc09e61)
-rw-r--r--src/mesa/main/fbobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 14c533e0d4..cc20f74790 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1766,10 +1766,10 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
rb = NULL;
}
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
+ rb && rb->Format != MESA_FORMAT_NONE) {
/* make sure the renderbuffer is a depth/stencil format */
- const GLenum baseFormat =
- _mesa_get_format_base_format(att->Renderbuffer->Format);
+ const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
if (baseFormat != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glFramebufferRenderbufferEXT(renderbuffer"