diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-08-29 22:46:09 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-09-14 08:59:16 -0400 |
commit | 2eebb01294530abff997bb82c0b980894c711bb6 (patch) | |
tree | 4fabb297a594d516c632007c16136ac5a3c0a061 | |
parent | 589919c3ec7ae314e11c86e62254ad5c2d5d0fd8 (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.c | 21 |
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 */ |