sna: Prevent sna_damage_contains_box__no_reduce() from a NULL deref

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-10-02 12:22:51 +01:00
parent 0ae6c2ccb0
commit bf44d9965b
1 changed files with 2 additions and 1 deletions

View File

@ -2855,7 +2855,8 @@ use_cpu_bo:
sna_damage_destroy(&priv->gpu_damage);
*damage = NULL;
} else {
if (sna_damage_contains_box__no_reduce(priv->cpu_damage,
if (priv->cpu_damage &&
sna_damage_contains_box__no_reduce(priv->cpu_damage,
&region.extents))
*damage = NULL;
else