i915g: Prevent NULL dereference.
authorChia-I Wu <olv@lunarg.com>
Wed, 10 Mar 2010 14:58:51 +0000 (22:58 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 10 Mar 2010 15:00:09 +0000 (23:00 +0800)
bind_vertex_elements_state may be called with NULL velems.  Do nothing
if that is the case.

src/gallium/drivers/i915/i915_state.c

index 8927dfc33d474177aeae2080b704399fefd119d5..377d8425a5cb11238969c7fe30ed63b76fddff78 100644 (file)
@@ -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