Mesa (master): softpipe/gs: don't crash with null shader

Zack Rusin zack at kemper.freedesktop.org
Fri Dec 25 02:55:45 PST 2009


Module: Mesa
Branch: master
Commit: 42eefb8235437655632b36490f49a3a8fdc69401
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=42eefb8235437655632b36490f49a3a8fdc69401

Author: Zack Rusin <zackr at vmware.com>
Date:   Wed Dec 23 12:34:34 2009 -0500

softpipe/gs: don't crash with null shader

---

 src/gallium/drivers/softpipe/sp_state_fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index 22f82b1..b904bde 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -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);
 }



More information about the mesa-commit mailing list