r600g: avoid segfault
authorJerome Glisse <jglisse@redhat.com>
Tue, 21 Dec 2010 15:49:53 +0000 (10:49 -0500)
committerJerome Glisse <jglisse@redhat.com>
Tue, 21 Dec 2010 15:51:32 +0000 (10:51 -0500)
Candidates 7.10

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index af19beb6f3cc741ed6ad375ebe5bb2d3bf5a00dd..8a69a10fc80559a3b3f30653865d2e639bdb1c10 100644 (file)
@@ -1334,7 +1334,7 @@ void evergreen_vertex_buffer_update(struct r600_pipe_context *rctx)
                        rbuffer = (struct r600_resource*)vertex_buffer->buffer;
                        offset = 0;
                }
-               if (vertex_buffer == NULL)
+               if (vertex_buffer == NULL || rbuffer == NULL)
                        continue;
                offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);
 
index 0d76afd6cd5c27997d94328e3d9e41b47b00cfed..9b099df18d44dc375ab3167bbaaa931ab57e9ec2 100644 (file)
@@ -174,7 +174,7 @@ void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
                        rbuffer = (struct r600_resource*)vertex_buffer->buffer;
                        offset = 0;
                }
-               if (vertex_buffer == NULL)
+               if (vertex_buffer == NULL || rbuffer == NULL)
                        continue;
                offset += vertex_buffer->buffer_offset + r600_bo_offset(rbuffer->bo);