st/mesa: fix renderbuffer pointer check in st_Clear()
authorBrian Paul <brianp@vmware.com>
Mon, 3 Jan 2011 20:57:13 +0000 (13:57 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Jan 2011 21:01:41 +0000 (14:01 -0700)
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.

src/mesa/state_tracker/st_cb_clear.c

index bd1dd78..6571bf2 100644 (file)
@@ -470,13 +470,9 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
          if (mask & (1 << b)) {
             struct gl_renderbuffer *rb
                = ctx->DrawBuffer->Attachment[b].Renderbuffer;
-            struct st_renderbuffer *strb;
+            struct st_renderbuffer *strb = st_renderbuffer(rb);
 
-            assert(rb);
-
-            strb = st_renderbuffer(rb);
-
-            if (!strb->surface)
+            if (!strb || !strb->surface)
                continue;
 
             if (check_clear_color_with_quad( ctx, rb ))