summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-11-21 14:52:41 +0000
committerRobin Watts <robin.watts@artifex.com>2012-11-21 14:55:27 +0000
commit17db20e94e9973ed76b033fbe30afc3fed20e5b6 (patch)
treebd16cc6ff1661d3b7a2bcfae38b5b7f72114b803 /fitz
parent92e95c9f19bfe54077389ecde805dafc960a62c6 (diff)
downloadmupdf-17db20e94e9973ed76b033fbe30afc3fed20e5b6.tar.xz
Bug 693458: Fix calculation of pointer offset in subsampler.
Thanks to zeniko for pointing this out. Non monochrome subsamples would have gone wrong in the last line.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/res_pixmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c
index 8eb489d1..be0196dd 100644
--- a/fitz/res_pixmap.c
+++ b/fitz/res_pixmap.c
@@ -898,7 +898,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
int back4 = strayX*n-1;
int strayY = h%f;
int divY = (strayY ? 65536/(strayY*f) : 0);
- int back5 = fwd * strayY - 1;
+ int back5 = fwd * strayY - n;
int divXY = (strayY*strayX ? 65536/(strayX*strayY) : 0);
fz_subsample_pixmap_ARM(s, w, h, f, factor, n, fwd, back,
back2, fwd2, divX, back4, fwd4, fwd3,
@@ -957,7 +957,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
if (y > 0)
{
int div = y * f;
- int back5 = fwd * y - 1;
+ int back5 = fwd * y - n;
for (x = w - f; x >= 0; x -= f)
{
for (nn = n; nn > 0; nn--)