summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-08 17:37:44 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-08 18:12:05 +0000
commit1cd06100185a37ee33209fb18362da89f9646e6b (patch)
tree4b1052ed23dc4b6c63e7430590e05224296ad097
parent4b100b099a4d5877c79989e8b3b4ffcd3aa2306f (diff)
sna: Protect against NULL deference of damage after reduction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index d5723eeb..26116cd6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1433,7 +1433,8 @@ sna_put_xybitmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
return false;
assert_pixmap_contains_box(pixmap, RegionExtents(region));
- sna_damage_add(damage, region);
+ if (damage)
+ sna_damage_add(damage, region);
DBG(("%s: upload(%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h));
@@ -1550,7 +1551,8 @@ sna_put_xypixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
return false;
assert_pixmap_contains_box(pixmap, RegionExtents(region));
- sna_damage_add(damage, region);
+ if (damage)
+ sna_damage_add(damage, region);
DBG(("%s: upload(%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h));