diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-07-01 06:54:06 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-07-02 18:21:21 -0400 |
commit | cd7ecf548a9e8115226bf0fec174f3abc54becb5 (patch) | |
tree | 6916c62dc45ce46883c6705fa90f7db87e79f764 | |
parent | 7b20ad39f778d765566d3f2c5f7c50964100efc1 (diff) |
In fast_composite_tiled_repeat() don't clone images with a palette
In fast_composite_tiled_repeat() if the source image is less than a
certain constant width, a clone is created which is then
pre-repeated. However, the source image's palette, if it has one, is
not cloned, so for indexed images, the pre-repeating would crash.
Fix this by not doing any pre-repeating for images with a palette set.
-rw-r--r-- | pixman/pixman-fast-path.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index e79b069..9778b0c 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -1280,8 +1280,9 @@ fast_composite_tiled_repeat (pixman_implementation_t *imp, src_bpp = PIXMAN_FORMAT_BPP (src_image->bits.format); - if (src_image->bits.width < REPEAT_MIN_WIDTH && - (src_bpp == 32 || src_bpp == 16 || src_bpp == 8)) + if (src_image->bits.width < REPEAT_MIN_WIDTH && + (src_bpp == 32 || src_bpp == 16 || src_bpp == 8) && + !src_image->bits.indexed) { sx = src_x; sx = MOD (sx, src_image->bits.width); |