From fa36e2315586735afa4944661ade423cf77e5d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Fri, 18 Jul 2014 16:07:00 +0200 Subject: 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. --- source/fitz/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/fitz/image.c') 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); } -- cgit v1.2.3