From: Chia-I Wu Date: Wed, 10 Mar 2010 14:58:51 +0000 (+0800) Subject: i915g: Prevent NULL dereference. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c47c73293d359c00abb34c39d1163b4c55f531de;p=mesa.git i915g: Prevent NULL dereference. bind_vertex_elements_state may be called with NULL velems. Do nothing if that is the case. --- diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 8927dfc33d4..377d8425a5c 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