mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 22:50:08 +01:00
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.
This commit is contained in:
parent
94028edfc5
commit
408f32dc16
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue