diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-03-10 22:58:51 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-03-10 23:00:09 +0800 |
commit | c47c73293d359c00abb34c39d1163b4c55f531de (patch) | |
tree | ae6ff8f0dd095091065fdba4af2f4f814d0729e6 /src/gallium/drivers/i915/i915_state.c | |
parent | e4848d21e8f384f4157076d5e7c7c9d38da6598e (diff) | |
download | external_mesa3d-c47c73293d359c00abb34c39d1163b4c55f531de.zip external_mesa3d-c47c73293d359c00abb34c39d1163b4c55f531de.tar.gz external_mesa3d-c47c73293d359c00abb34c39d1163b4c55f531de.tar.bz2 |
i915g: Prevent NULL dereference.
bind_vertex_elements_state may be called with NULL velems. Do nothing
if that is the case.
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_state.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 8927dfc..377d842 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -770,7 +770,10 @@ i915_bind_vertex_elements_state(struct pipe_context *pipe, draw_flush(i915->draw); /* pass-through to draw module */ - draw_set_vertex_elements(i915->draw, i915_velems->count, i915_velems->velem); + if (i915_velems) { + draw_set_vertex_elements(i915->draw, + i915_velems->count, i915_velems->velem); + } } static void |