[Mesa-dev] [PATCH 6/8] draw/gs: Return early if the passed geometry shader is null

Zack Rusin zackr at vmware.com
Tue Apr 16 20:36:46 PDT 2013


Can happen if we were using stream output without geometry
shader, by returning early we avoid a crash.
---
 src/gallium/auxiliary/draw/draw_gs.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index ce820ef..5771aad 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -787,6 +787,9 @@ void draw_bind_geometry_shader(struct draw_context *draw,
 void draw_delete_geometry_shader(struct draw_context *draw,
                                  struct draw_geometry_shader *dgs)
 {
+   if (!dgs) {
+      return;
+   }
 #ifdef HAVE_LLVM
    if (draw_get_option_use_llvm()) {
       struct llvm_geometry_shader *shader = llvm_geometry_shader(dgs);
-- 
1.7.10.4



More information about the mesa-dev mailing list