mesa: check renderbuffer is defined before use.
authorAlan Hourihane <alanh@vmware.com>
Thu, 19 Mar 2009 13:58:04 +0000 (13:58 +0000)
committerAlan Hourihane <alanh@vmware.com>
Thu, 19 Mar 2009 13:59:09 +0000 (13:59 +0000)
src/mesa/state_tracker/st_atom_framebuffer.c

index b32009c19bbe6e551d65462be68e9015a20b369c..df0f0931eab38f7a5ab264616927e648731df7e2 100644 (file)
@@ -112,15 +112,17 @@ update_framebuffer_state( struct st_context *st )
    for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
       strb = st_renderbuffer(fb->_ColorDrawBuffers[i]);
 
-      /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
-      if (strb->rtt) {
-         /* rendering to a GL texture, may have to update surface */
-         update_renderbuffer_surface(st, strb);
-      }
+      if (strb) {
+         /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
+         if (strb->rtt) {
+            /* rendering to a GL texture, may have to update surface */
+            update_renderbuffer_surface(st, strb);
+         }
 
-      if (strb->surface) {
-         framebuffer->cbufs[framebuffer->nr_cbufs] = strb->surface;
-         framebuffer->nr_cbufs++;
+         if (strb->surface) {
+            framebuffer->cbufs[framebuffer->nr_cbufs] = strb->surface;
+            framebuffer->nr_cbufs++;
+         }
       }
    }