summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-11 16:54:48 -0700
committerBrian Paul <brianp@vmware.com>2010-02-11 16:54:48 -0700
commit04d35714a6e10f96f8a216c626f46fdfbc2e5c1f (patch)
tree6e9b798447c3f7e76ecab75616d09ab0732b3e01
parent92098438784887fd6005918794476cfbbeac5035 (diff)
svga: check min_index, max_index before assertions
It's possible for min_index and max_index to be ~0 if the min/max values were not actually set or computed in the state tracker. Skip some assertions in that case. This only effects the debug build error checking. (cherry picked from commit 408f32dc165b36eb5ec0e2bbc7dcecd28f3a62d3)
-rw-r--r--src/gallium/drivers/svga/svga_draw.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c
index f4d2d8992c8..8b7ca2e1123 100644
--- a/src/gallium/drivers/svga/svga_draw.c
+++ b/src/gallium/drivers/svga/svga_draw.c
@@ -253,7 +253,9 @@ enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl,
assert(index_bias >= 0);
assert(min_index <= max_index);
assert(offset + index_bias*stride < size);
- assert(offset + (index_bias + min_index)*stride < size);
+ if (min_index != ~0) {
+ assert(offset + (index_bias + min_index) * stride < size);
+ }
switch (hwtnl->cmd.vdecl[i].identity.type) {
case SVGA3D_DECLTYPE_FLOAT1:
@@ -314,7 +316,9 @@ enum pipe_error svga_hwtnl_prim( struct svga_hwtnl *hwtnl,
}
assert(!stride || width <= stride);
- assert(offset + (index_bias + max_index)*stride + width <= size);
+ if (max_index != ~0) {
+ assert(offset + (index_bias + max_index) * stride + width <= size);
+ }
}
assert(range->indexWidth == range->indexArray.stride);