i915tex: Don't crash when intel_fb->color_rb[i] is NULL.
authorMichel Dänzer <michel@tungstengraphics.com>
Mon, 12 Mar 2007 18:08:28 +0000 (19:08 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Mon, 12 Mar 2007 18:08:28 +0000 (19:08 +0100)
This can be the case on some systems when running glxinfo.

src/mesa/drivers/dri/i915tex/intel_buffers.c

index 45fd2fa8de0269d626711ebab8260607ca3ff1b4..62ff54b00751c3241967742edd1a6375205bba99 100644 (file)
@@ -327,6 +327,9 @@ intelWindowMoved(struct intel_context *intel)
         }
 
         for (i = 0; i < intel_fb->pf_num_pages; i++) {
+           if (!intel_fb->color_rb[i])
+              continue;
+
            vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending;
            drmWaitVBlank(intel->driFd, &vbl);
         }
@@ -336,7 +339,8 @@ intelWindowMoved(struct intel_context *intel)
         intel_fb->vbl_waited = intel_fb->vbl_seq;
 
         for (i = 0; i < intel_fb->pf_num_pages; i++) {
-           intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited;
+           if (intel_fb->color_rb[i])
+              intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited;
         }
       }
    } else {