summaryrefslogtreecommitdiff
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
parentbf7a5bbe52b3d6f74db37756518c4215a3c04a62 (diff)
downloadmupdf-9e9b8d89356c76a264b6675db917333a18b86399.tar.xz
Apply decode array for image masks.
-rw-r--r--draw/imageunpack.c4
-rw-r--r--mupdf/pdf_image.c2
2 files changed, 3 insertions, 3 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;
}
}
diff --git a/mupdf/pdf_image.c b/mupdf/pdf_image.c
index 24b25751..6350c858 100644
--- a/mupdf/pdf_image.c
+++ b/mupdf/pdf_image.c
@@ -105,7 +105,7 @@ pdf_loadimageheader(pdf_image **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict)
pdf_dropimage(img);
return fz_rethrow(error, "cannot load image mask/softmask");
}
- img->mask->imagemask = 1; /* TODO: this triggers bit inversion later. should we? */
+ img->mask->imagemask = 1;
if (img->mask->colorspace)
{
fz_dropcolorspace(img->mask->colorspace);