summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-08-29 22:46:09 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-09-14 08:59:16 -0400
commit2eebb01294530abff997bb82c0b980894c711bb6 (patch)
tree4fabb297a594d516c632007c16136ac5a3c0a061
parent589919c3ec7ae314e11c86e62254ad5c2d5d0fd8 (diff)
Clip composite region against the destination alpha map extents.more-alpha
Otherwise we can end up writing outside the alpha map.
-rw-r--r--pixman/pixman.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/pixman/pixman.c b/pixman/pixman.c
index cdf4b75e..285bbfc6 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -315,14 +315,27 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
return FALSE;
}
- if (dst_image->common.alpha_map && dst_image->common.alpha_map->common.have_clip_region)
+ if (dst_image->common.alpha_map)
{
- if (!clip_general_image (region, &dst_image->common.alpha_map->common.clip_region,
- -dst_image->common.alpha_origin_x,
- -dst_image->common.alpha_origin_y))
+ if (!pixman_region32_intersect_rect (region, region,
+ dst_image->common.alpha_origin_x,
+ dst_image->common.alpha_origin_y,
+ dst_image->common.alpha_map->width,
+ dst_image->common.alpha_map->height))
{
return FALSE;
}
+ if (!pixman_region32_not_empty (region))
+ return FALSE;
+ if (dst_image->common.alpha_map->common.have_clip_region)
+ {
+ if (!clip_general_image (region, &dst_image->common.alpha_map->common.clip_region,
+ -dst_image->common.alpha_origin_x,
+ -dst_image->common.alpha_origin_y))
+ {
+ return FALSE;
+ }
+ }
}
/* clip against src */