From: Søren Sandmann Pedersen Date: Mon, 30 Aug 2010 02:46:09 +0000 (-0400) Subject: Clip composite region against the destination alpha map extents. X-Git-Tag: 1.0_branch~488 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=add0fd1bac84a5b6dddf7632b4100d6b3f2ebc18;p=profile%2Fivi%2Fpixman.git Clip composite region against the destination alpha map extents. Otherwise we can end up writing outside the alpha map. --- diff --git a/pixman/pixman.c b/pixman/pixman.c index cdf4b75..285bbfc 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 */