summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-07-18 16:07:00 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-07-18 16:07:58 +0200
commitfa36e2315586735afa4944661ade423cf77e5d32 (patch)
tree947e8e108ad83711ef3c1838f13a399f3d965d91 /source/fitz
parent46f3f26d485f113f309336404ee4172b7f8c15a2 (diff)
downloadmupdf-fa36e2315586735afa4944661ade423cf77e5d32.tar.xz
fix off-by-one error in fz_unblend_masked_tile
fz_image::n is used inconsistently: Sometimes it includes the alpha channel and sometimes it doesn't. At the point where fz_unblend_masked_tile is called, it doesn't.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 9fd859e9..556e841b 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -135,10 +135,10 @@ fz_unblend_masked_tile(fz_context *ctx, fz_pixmap *tile, fz_image *image)
for (; s < end; s++, d += tile->n)
{
if (*s == 0)
- for (k = 0; k < image->n - 1; k++)
+ for (k = 0; k < image->n; k++)
d[k] = image->colorkey[k];
else
- for (k = 0; k < image->n - 1; k++)
+ for (k = 0; k < image->n; k++)
d[k] = fz_clampi(image->colorkey[k] + (d[k] - image->colorkey[k]) * 255 / *s, 0, 255);
}