From: Zack Rusin Date: Wed, 17 Apr 2013 03:17:08 +0000 (-0700) Subject: draw/gs: Return early if the passed geometry shader is null X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be497ac9d3b5c50a4cd126578081bd54b68f16a9;p=mesa.git draw/gs: Return early if the passed geometry shader is null Can happen if we were using stream output without geometry shader, by returning early we avoid a crash. Signed-off-by: Zack Rusin Reviewed-by: Jose Fonseca --- diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index f8cb04a8f39..987c01a7919 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -788,6 +788,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);