summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-07-25 16:04:24 +0000
committerTor Andersson <tor@ghostscript.com>2010-07-25 16:04:24 +0000
commit9e9b8d89356c76a264b6675db917333a18b86399 (patch)
tree02fdfa73f8b5abe3c2d7c101a4109b17064b632d /draw
parentbf7a5bbe52b3d6f74db37756518c4215a3c04a62 (diff)
downloadmupdf-9e9b8d89356c76a264b6675db917333a18b86399.tar.xz
Apply decode array for image masks.
Diffstat (limited to 'draw')
-rw-r--r--draw/imageunpack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/draw/imageunpack.c b/draw/imageunpack.c
index 4465d587..bbc22c70 100644
--- a/draw/imageunpack.c
+++ b/draw/imageunpack.c
@@ -199,7 +199,7 @@ fz_decodetile(fz_pixmap *pix, float *decode)
int mul[FZ_MAXCOLORS];
unsigned char *p = pix->samples;
int len = pix->w * pix->h;
- int n = pix->n - 1;
+ int n = MAX(1, pix->n - 1);
int needed;
int k;
@@ -220,6 +220,6 @@ fz_decodetile(fz_pixmap *pix, float *decode)
{
for (k = 0; k < n; k++)
p[k] = add[k] + fz_mul255(p[k], mul[k]);
- p += n + 1;
+ p += pix->n;
}
}