projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d93a07
)
i965: Assert that the GL primitive isn't out of range.
author
Matt Turner
<mattst88@gmail.com>
Mon, 22 Jun 2015 18:20:32 +0000
(11:20 -0700)
committer
Matt Turner
<mattst88@gmail.com>
Tue, 23 Jun 2015 19:24:42 +0000
(12:24 -0700)
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>
src/mesa/drivers/dri/i965/brw_draw.c
patch
|
blob
|
history
diff --git
a/src/mesa/drivers/dri/i965/brw_draw.c
b/src/mesa/drivers/dri/i965/brw_draw.c
index a7164dbf7d8bd5fcc42c02e8bfa7b00f0c71e134..b91597a9f5dbbdec0c9d050155aff7cd0c7cd768 100644
(file)
--- a/
src/mesa/drivers/dri/i965/brw_draw.c
+++ b/
src/mesa/drivers/dri/i965/brw_draw.c
@@
-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];
+ }
}