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-21 08:31:08 -0400
commitadd0fd1bac84a5b6dddf7632b4100d6b3f2ebc18 (patch)
tree36943375a845f3df3616bde86b13b16dd15d5997
parentaf2f0080feada1abe569e2031acacf51be7f8f68 (diff)
Clip composite region against the destination alpha map extents.
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 */