From: Xiang, Haihao Date: Mon, 17 Dec 2007 06:42:42 +0000 (+0800) Subject: i965: check NULL pointer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d859a60dc3b8aa7d8405c5839a21850c0838f07f;p=mesa.git i965: check NULL pointer --- diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index f940cea4cd1..e361ab5a704 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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,