From 1cd06100185a37ee33209fb18362da89f9646e6b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 8 Nov 2011 17:37:44 +0000 Subject: sna: Protect against NULL deference of damage after reduction Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 6 ++++-- 1 file 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)); -- cgit v1.2.3