i965: check NULL pointer
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 17 Dec 2007 06:42:42 +0000 (14:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 17 Dec 2007 06:42:42 +0000 (14:42 +0800)
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index f940cea4cd16732b135f8af2faa71a5dae1a5da0..e361ab5a704782884904c8e081312bd410c0fc7d 100644 (file)
@@ -247,7 +247,10 @@ brw_wm_get_binding_table(struct brw_context *brw)
       int i;
 
       for (i = 0; i < brw->wm.nr_surfaces; i++)
-        data[i] = brw->wm.surf_bo[i]->offset;
+         if (brw->wm.surf_bo[i])
+            data[i] = brw->wm.surf_bo[i]->offset;
+         else
+            data[i] = 0;
 
       bind_bo = brw_upload_cache( &brw->cache, BRW_SS_SURF_BIND,
                                  NULL, 0,