summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-08-16 07:24:48 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-08-21 06:29:36 -0400
commit393ccab74e9aa466e2fdd91319012e2c18f4ef84 (patch)
treeb6d5ffc63b450d8734238c1122dea35bba79483e
parentda6f33a798bf2ea10df610ccf1d9506d63d1a28c (diff)
Only try to compute the FAST_SAMPLES_COVER_CLIP for bits images
It doesn't make sense in other cases, and the computation would make use of image->bits.{width,height} which lead to uninitialized memory accesses when the image wasn't of type BITS.
-rw-r--r--pixman/pixman.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/pixman/pixman.c b/pixman/pixman.c
index 55c5981e..ddd49357 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -787,14 +787,17 @@ analyze_extent (pixman_image_t *image, int x, int y,
if (!compute_sample_extents (transform, &ex, x, y, x_off, y_off, width, height))
return FALSE;
- /* Check whether the non-expanded, transformed extent is entirely within
- * the source image, and set the FAST_PATH_SAMPLES_COVER_CLIP if it is.
- */
- ex = *extents;
- if (compute_sample_extents (transform, &ex, x, y, x_off, y_off, width, height))
+ if (image->type == BITS)
{
- if (ex.x1 >= 0 && ex.y1 >= 0 && ex.x2 <= image->bits.width && ex.y2 <= image->bits.height)
- *flags |= FAST_PATH_SAMPLES_COVER_CLIP;
+ /* Check whether the non-expanded, transformed extent is entirely within
+ * the source image, and set the FAST_PATH_SAMPLES_COVER_CLIP if it is.
+ */
+ ex = *extents;
+ if (compute_sample_extents (transform, &ex, x, y, x_off, y_off, width, height))
+ {
+ if (ex.x1 >= 0 && ex.y1 >= 0 && ex.x2 <= image->bits.width && ex.y2 <= image->bits.height)
+ *flags |= FAST_PATH_SAMPLES_COVER_CLIP;
+ }
}
return TRUE;