r300g: fix crash while binding a NULL constant buffer
authorMarek Olšák <maraeo@gmail.com>
Thu, 21 Mar 2013 18:29:29 +0000 (19:29 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 26 Mar 2013 00:28:18 +0000 (01:28 +0100)
src/gallium/drivers/r300/r300_state.c

index ad93510ab3ff01145dbb7ad849a6ea9e18459f10..2de0fd6b7f988d2f9270997371179c791dfb9cf0 100644 (file)
@@ -2056,7 +2056,7 @@ static void r300_set_constant_buffer(struct pipe_context *pipe,
     struct r300_constant_buffer *cbuf;
     uint32_t *mapped;
 
-    if (!cb)
+    if (!cb || (!cb->buffer && !cb->user_buffer))
         return;
 
     switch (shader) {