diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-17 22:51:29 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-17 23:12:49 +0000 |
commit | 850495f956c811b1eb617d2e704e6bb7b5a86369 (patch) | |
tree | f1c1eb651ea3816a453eaf88061b1777293be264 /src/sna/sna_damage.c | |
parent | 4b5c9affd4968fd5b3d85551cf5a0b4d600a7892 (diff) |
sna: Fix increment of damage boxes after updating for rectangles
Found by valgrind:
==13639== Conditional jump or move depends on uninitialised value(s)
==13639== at 0x5520B1E: pixman_region_init_rects (in
/usr/lib/x86_64-linux-gnu/libpixman-1.so.0.24.0)
==13639== by 0x89E6ED7: __sna_damage_reduce (sna_damage.c:489)
==13639== by 0x89E7FEC: _sna_damage_contains_box (sna_damage.c:1161)
==13639== by 0x89CFCD9: sna_drawable_use_gpu_bo (sna_damage.h:175)
==13639== by 0x89D52DA: sna_poly_segment (sna_accel.c:6130)
==13639== by 0x21F87E: damagePolySegment (damage.c:1096)
==13639== by 0x1565A2: ProcPolySegment (dispatch.c:1771)
==13639== by 0x159FB0: Dispatch (dispatch.c:437)
==13639== by 0x1491D9: main (main.c:287)
==13639== Uninitialised value was created by a heap allocation
==13639== at 0x4028693: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13639== by 0x89E6BFB: _sna_damage_create_boxes (sna_damage.c:205)
==13639== by 0x89E78F0: _sna_damage_add_rectangles (sna_damage.c:327)
==13639== by 0x89CD32D: sna_poly_fill_rect_blt.isra.65
(sna_damage.h:68)
==13639== by 0x89DE23F: sna_poly_fill_rect (sna_accel.c:8366)
==13639== by 0x21E9C8: damagePolyFillRect (damage.c:1309)
==13639== by 0x26DD3F: miPaintWindow (miexpose.c:674)
==13639== by 0x18370A: ChangeWindowAttributes (window.c:1553)
==13639== by 0x154500: ProcChangeWindowAttributes (dispatch.c:696)
==13639== by 0x159FB0: Dispatch (dispatch.c:437)
==13639== by 0x1491D9: main (main.c:287)
==13639==
Use 'count' everywhere for consistency.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_damage.c')
-rw-r--r-- | src/sna/sna_damage.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c index 196f4792..a68db552 100644 --- a/src/sna/sna_damage.c +++ b/src/sna/sna_damage.c @@ -287,8 +287,8 @@ _sna_damage_create_elt_from_boxes(struct sna_damage *damage, damage->box[i].y1 = boxes[i].y1 + dy; damage->box[i].y2 = boxes[i].y2 + dy; } - damage->box += i; - damage->remain -= i; + damage->box += count; + damage->remain -= count; return damage; } @@ -333,8 +333,8 @@ _sna_damage_create_elt_from_rectangles(struct sna_damage *damage, damage->box[i].y1 = r[i].y + dy; damage->box[i].y2 = damage->box[i].y1 + r[i].height; } - damage->box += n; - damage->remain -= n; + damage->box += count; + damage->remain -= count; return damage; } |