From d859a60dc3b8aa7d8405c5839a21850c0838f07f Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Mon, 17 Dec 2007 14:42:42 +0800 Subject: [PATCH] i965: check NULL pointer --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- 2.30.2