sna: Protect against NULL deference of damage after reduction

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-11-08 17:37:44 +00:00
parent 4b100b099a
commit 1cd0610018
1 changed files with 4 additions and 2 deletions

View File

@ -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));