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 f0065ad06a9e77d5a2c65651b57d7fa0023e3cc7..eb1fef51427d47c7007a12198de14e73d18e2397 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;
       }