mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
i965: Assert that the GL primitive isn't out of range.
Coverity sees the if (mode >= BRW_PRIM_OFFSET (128)) test and assumes that the else-branch might execute for mode to up 127, which out be out of bounds. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
4d93a07c45
commit
d8eeb4917c
1 changed files with 3 additions and 1 deletions
|
|
@ -92,8 +92,10 @@ get_hw_prim_for_gl_prim(int mode)
|
|||
{
|
||||
if (mode >= BRW_PRIM_OFFSET)
|
||||
return mode - BRW_PRIM_OFFSET;
|
||||
else
|
||||
else {
|
||||
assert(mode < ARRAY_SIZE(prim_to_hw_prim));
|
||||
return prim_to_hw_prim[mode];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue