softpipe/gs: don't crash with null shader
authorZack Rusin <zackr@vmware.com>
Wed, 23 Dec 2009 17:34:34 +0000 (12:34 -0500)
committerZack Rusin <zackr@vmware.com>
Fri, 25 Dec 2009 10:52:17 +0000 (05:52 -0500)
src/gallium/drivers/softpipe/sp_state_fs.c

index 22f82b1a4296c9dce5d5e0be3b4fc442e054c46b..b904bde25caa176e35aa7d7f8a3c11527eeec5e3 100644 (file)
@@ -221,6 +221,7 @@ softpipe_delete_gs_state(struct pipe_context *pipe, void *gs)
    struct sp_geometry_shader *state =
       (struct sp_geometry_shader *)gs;
 
-   draw_delete_geometry_shader(softpipe->draw, state->draw_data);
+   draw_delete_geometry_shader(softpipe->draw,
+                               (state) ? state->draw_data : 0);
    FREE(state);
 }