mesa: Guard against null pointer deref in fbo validation
authorFabian Bieler <der.fabe@gmx.net>
Tue, 5 Apr 2011 13:51:01 +0000 (07:51 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 5 Apr 2011 13:51:01 +0000 (07:51 -0600)
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>
src/mesa/main/fbobject.c

index f0065ad..eb1fef5 100644 (file)
@@ -746,7 +746,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
          continue;
       }
 
-      if (numSamples < 0) {
+      if (att->Renderbuffer && numSamples < 0) {
          /* first buffer */
          numSamples = att->Renderbuffer->NumSamples;
       }