diff options
author | José Fonseca <jfonseca@vmware.com> | 2012-02-02 13:19:56 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2012-02-02 14:45:30 +0000 |
commit | edb19707951306447daef43c1ea3cacec5f211fb (patch) | |
tree | ccc12b60d2772c28b11ba4955d511fc8ca1081ed /src/gallium/auxiliary/draw/draw_pipe_pstipple.c | |
parent | efd73f72d8f34a40d6a1cd279fffa48dc13b6e5b (diff) |
draw: Avoid NULL pointer dereference when binding NULL fragment shaders.
Now that the draw module avoids flushing, it may flush precisely when
binding a NULL shader, so care must be taken when restoring the original
fragment shader.
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 0401a45507b..62c54b35bc7 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -565,7 +565,7 @@ pstip_flush(struct draw_stage *stage, unsigned flags) /* restore original frag shader, texture, sampler state */ draw->suspend_flushing = TRUE; - pstip->driver_bind_fs_state(pipe, pstip->fs->driver_fs); + pstip->driver_bind_fs_state(pipe, pstip->fs ? pstip->fs->driver_fs : NULL); pstip->driver_bind_sampler_states(pipe, pstip->num_samplers, pstip->state.samplers); pstip->driver_set_sampler_views(pipe, |