[Mesa-dev] [PATCH] mesa/st: only compare the current scissor
Ilia Mirkin
imirkin at alum.mit.edu
Wed Mar 5 19:38:05 PST 2014
sizeof(scissor) returns the size of the full array rather than a single
element. Fix it to consider just the one element.
Fixes: 0705fa35cdaf15ec969c28dc85e88b8be1149a3b
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
Noticed this when playing with valgrind for unrelated reasons. Seems fairly
obvious.
src/mesa/state_tracker/st_atom_scissor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
index a19ade1..b720309 100644
--- a/src/mesa/state_tracker/st_atom_scissor.c
+++ b/src/mesa/state_tracker/st_atom_scissor.c
@@ -85,7 +85,7 @@ update_scissor( struct st_context *st )
scissor[i].maxy = maxy;
}
- if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor)) != 0) {
+ if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor[0])) != 0) {
/* state has changed */
st->state.scissor[i] = scissor[i]; /* struct copy */
changed = true;
--
1.8.3.2
More information about the mesa-dev
mailing list