aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2013-09-27 21:46:33 -0700
committerVinson Lee <[email protected]>2013-09-30 21:46:42 -0700
commit505a6de7fc5e281d0faf7950cc97fbe88cd9bbf4 (patch)
tree1e66c39101c55d41afb3b345c156e259b32f4b03
parent9b388c66fc8e002f442eafc669ca31d99a807b5a (diff)
draw: Add a null check for draw.
There is an earlier null check for draw so draw could be null here as well. Fixes "Dereference after null check" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_unfilled.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
index 7a88ce0f6d7..8cba07c34bc 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
@@ -237,7 +237,7 @@ draw_unfilled_prepare_outputs( struct draw_context *draw,
boolean is_unfilled = (rast &&
(rast->fill_front != PIPE_POLYGON_MODE_FILL ||
rast->fill_back != PIPE_POLYGON_MODE_FILL));
- const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
+ const struct draw_fragment_shader *fs = draw ? draw->fs.fragment_shader : 0;
if (is_unfilled && fs && fs->info.uses_frontface) {
unfilled->face_slot = draw_alloc_extra_vertex_attrib(