softpipe: Prevent NULL dereference.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 10 Mar 2010 12:24:03 +0000 (12:24 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 10 Mar 2010 12:24:03 +0000 (12:24 +0000)
src/gallium/drivers/softpipe/sp_state_vertex.c

index a151758ddcad96c79f6144952e13f50401313f8b..462f4d2655ef7ba75c0a7189c4bddcbb63486ba7 100644 (file)
@@ -62,7 +62,8 @@ softpipe_bind_vertex_elements_state(struct pipe_context *pipe,
 
    softpipe->dirty |= SP_NEW_VERTEX;
 
-   draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem);
+   if (sp_velems)
+      draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem);
 }
 
 void