softpipe: small cleanup
authorZack Rusin <zackr@vmware.com>
Sat, 12 Jun 2010 14:40:39 +0000 (10:40 -0400)
committerZack Rusin <zackr@vmware.com>
Sat, 12 Jun 2010 14:45:42 +0000 (10:45 -0400)
src/gallium/drivers/softpipe/sp_state_so.c

index 27acd3dfc12d8eb169f595b1214274274653f246..cfe23f9e84616a5b9a50e30739bf1b888dd3204f 100644 (file)
@@ -89,6 +89,8 @@ softpipe_set_stream_output_buffers(struct pipe_context *pipe,
    void *map_buffers[PIPE_MAX_SO_BUFFERS];
 
    assert(num_buffers <= PIPE_MAX_SO_BUFFERS);
+   if (num_buffers > PIPE_MAX_SO_BUFFERS)
+      num_buffers = PIPE_MAX_SO_BUFFERS;
 
    softpipe->dirty |= SP_NEW_SO_BUFFERS;
 
@@ -99,7 +101,7 @@ softpipe_set_stream_output_buffers(struct pipe_context *pipe,
       if (!res) {
          /* the whole call is invalid, bail out */
          softpipe->so_target.num_buffers = 0;
-         draw_set_mapped_so_buffers(softpipe->draw, map_buffers, 0);
+         draw_set_mapped_so_buffers(softpipe->draw, 0, 0);
          return;
       }