diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-05-24 13:46:28 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-05-26 10:36:35 +0100 |
commit | ee972fbfa1093fe2e8641dc450e1c20347df2b04 (patch) | |
tree | 8ff2a934f13e3804a28e21ce5bd0eabfde5b549d /source/fitz/draw-unpack.c | |
parent | dff58514f30b10850bab0205580af98ec3217d64 (diff) | |
download | mupdf-ee972fbfa1093fe2e8641dc450e1c20347df2b04.tar.xz |
Avoid unnecessary alphas when decompressing images from streams.
Diffstat (limited to 'source/fitz/draw-unpack.c')
-rw-r--r-- | source/fitz/draw-unpack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/fitz/draw-unpack.c b/source/fitz/draw-unpack.c index ccb3c62f..0211b7e4 100644 --- a/source/fitz/draw-unpack.c +++ b/source/fitz/draw-unpack.c @@ -179,7 +179,8 @@ fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int unsigned char *p = pix->samples; int stride = pix->stride - pix->w * pix->n; int len; - int n = pix->n - 1; + int pn = pix->n; + int n = pn - pix->alpha; int needed; int k; int h; @@ -208,7 +209,7 @@ fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int int value = (add[k] + (((p[k] << 8) * mul[k]) >> 8)) >> 8; p[k] = fz_clampi(value, 0, 255); } - p += n + 1; + p += pn; } p += stride; } |