summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-15 01:19:01 +0100
committerMarek Olšák <[email protected]>2011-02-15 01:19:54 +0100
commit4faf11ad6c44902e17c648c28d40e10067f83612 (patch)
treef1017474dcc308901608b88016210ef9a6fc3609 /src/gallium/drivers/r300/r300_state.c
parent56029ce52bafbc51b5b6660383767257b7770cd7 (diff)
r300g: fix SIGFPE on debug builds
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 1ec942854ff..aa18ab7d1e3 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1511,9 +1511,9 @@ static void r300_set_index_buffer(struct pipe_context* pipe,
{
struct r300_context* r300 = r300_context(pipe);
- assert(ib->offset % ib->index_size == 0);
-
if (ib && ib->buffer) {
+ assert(ib->offset % ib->index_size == 0);
+
pipe_resource_reference(&r300->index_buffer.buffer, ib->buffer);
memcpy(&r300->index_buffer, ib, sizeof(r300->index_buffer));
r300->index_buffer.offset /= r300->index_buffer.index_size;