From 8aff99e231dcb83fa6c08e760711b0a1e979d012 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Thu, 10 Sep 2009 21:33:24 -0400 Subject: [PATCH] Fix off-by-one error in source_image_needs_out_of_bounds_workaround() If extents->x2/y2 are equal to image->width/height, then the clip is still inside the drawable, so no workaround is necessary. --- pixman/pixman-bits-image.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 6b80189..4e78ce1 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -612,14 +612,14 @@ source_image_needs_out_of_bounds_workaround (bits_image_t *image) { if (!image->common.client_clip) { - /* There is no client clip, so the drawable in question - * is a window if the clip region extends beyond the - * drawable geometry. + /* There is no client clip, so if the clip region extends beyond the + * drawable geometry, it must be because the X server generated the + * bogus clip region. */ const pixman_box32_t *extents = pixman_region32_extents (&image->common.clip_region); - if (extents->x1 >= 0 && extents->x2 < image->width && - extents->y1 >= 0 && extents->y2 < image->height) + if (extents->x1 >= 0 && extents->x2 <= image->width && + extents->y1 >= 0 && extents->y2 <= image->height) { return FALSE; } -- 2.7.4