summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-04-05 07:54:04 -0600
committerBrian Paul <brianp@vmware.com>2011-04-05 07:54:04 -0600
commit33129c040b4774ce7ea5b78bb7271e478bf4472e (patch)
tree11c14965c0ee73bde3b896e06ae28c0df021c3e7
parented5c9ae0168ff895e7cab2491882205bc987750c (diff)
mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared. At least with the gallium state tracker this can actually occur if st_render_texture fails. Signed-off-by: Brian Paul <brianp@vmware.com> (cherry picked from commit c7339d42c603048c0f89276da6576647c4421ba0)
-rw-r--r--src/mesa/main/fbobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 42fab1bf3e4..a98200e3183 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -690,7 +690,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
continue;
}
- if (numSamples < 0) {
+ if (att->Renderbuffer && numSamples < 0) {
/* first buffer */
numSamples = att->Renderbuffer->NumSamples;
}