r300g/swtcl: fix crash when setting vertex buffers
authorMarek Olšák <maraeo@gmail.com>
Fri, 4 Jan 2013 17:27:21 +0000 (18:27 +0100)
committerMarek Olšák <maraeo@gmail.com>
Fri, 4 Jan 2013 20:08:28 +0000 (21:08 +0100)
Broken by e73bf3b805de78299f1a652668ba4e6eab9bac94.

src/gallium/drivers/r300/r300_state.c

index 050c8f44550c971b3d03f369c80c2325f82996bc..29e28b4dfb1cd25375cac3a20d8795dbc7dcaa30 100644 (file)
@@ -1659,6 +1659,9 @@ static void r300_set_vertex_buffers_swtcl(struct pipe_context* pipe,
                                   buffers, start_slot, count);
     draw_set_vertex_buffers(r300->draw, start_slot, count, buffers);
 
+    if (!buffers)
+        return;
+
     for (i = 0; i < count; i++) {
         if (buffers[i].user_buffer) {
             draw_set_mapped_vertex_buffer(r300->draw, start_slot + i,