summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-02-27 16:21:36 +0000
committerRobin Watts <robin.watts@artifex.com>2013-02-27 16:21:36 +0000
commit4d7c32754abb96b5cbbea6cd98d5ca386ad2a81e (patch)
tree69af71c711d0d9b493ad8f1586001138c986ac7e /draw
parent963c5f195d44fd46d79c312f35dc3c4d623a8a16 (diff)
downloadmupdf-4d7c32754abb96b5cbbea6cd98d5ca386ad2a81e.tar.xz
Bug 693640: Fix interpolated painting of images going out of range
When calculating the texture position for interpolated painting we apply a voodoo correction. This was causing problems by taking us out of bounds; simply add some checks to avoid this taking us out of range. This causes many differences, all small, or progressions. In particular it solves several 'white lines' cases where images didn't quite line up.
Diffstat (limited to 'draw')
-rw-r--r--draw/draw_affine.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/draw/draw_affine.c b/draw/draw_affine.c
index 32e890f8..c0fe1fea 100644
--- a/draw/draw_affine.c
+++ b/draw/draw_affine.c
@@ -673,7 +673,11 @@ fz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz
* that we have found. */
if (dolerp) {
u -= 32768;
+ if (u < 0)
+ u = 0;
v -= 32768;
+ if (v < 0)
+ v = 0;
}
dp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);