projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f252974
)
fix cache overflow bug in get_vertex()
author
Brian
<brian.paul@tungstengraphics.com>
Mon, 20 Aug 2007 17:41:23 +0000
(11:41 -0600)
committer
Brian
<brian.paul@tungstengraphics.com>
Mon, 20 Aug 2007 17:41:23 +0000
(11:41 -0600)
src/mesa/pipe/draw/draw_prim.c
patch
|
blob
|
history
diff --git
a/src/mesa/pipe/draw/draw_prim.c
b/src/mesa/pipe/draw/draw_prim.c
index
95e71ef
..
fb8bc0f
100644
(file)
--- a/
src/mesa/pipe/draw/draw_prim.c
+++ b/
src/mesa/pipe/draw/draw_prim.c
@@
-144,8
+144,8
@@
static struct vertex_header *get_vertex( struct draw_context *draw,
/* If slot is in use, use the overflow area:
*/
- if (draw->vcache.referenced & (1
<<slot))
- slot = draw->vcache.overflow++;
+ if (draw->vcache.referenced & (1
<< slot))
+ slot =
VCACHE_SIZE +
draw->vcache.overflow++;
draw->vcache.idx[slot] = i;
@@
-158,7
+158,8
@@
static struct vertex_header *get_vertex( struct draw_context *draw,
/* Mark slot as in-use:
*/
- draw->vcache.referenced |= (1<<slot);
+ if (slot < VCACHE_SIZE)
+ draw->vcache.referenced |= (1 << slot);
return draw->vcache.vertex[slot];
}