From 8b08ca2917b6230a88719cc516f791cbb6845180 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 9 May 2016 16:48:50 +0100 Subject: Bug 696759: Fix pdf image subregion decode. When decoding < 8 bpp images, we need to allow for the fact that the data is byte aligned at the end of each row by being careful in our calculation of r_skip. --- source/fitz/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/fitz') diff --git a/source/fitz/image.c b/source/fitz/image.c index cf61fd28..63fed0bc 100644 --- a/source/fitz/image.c +++ b/source/fitz/image.c @@ -195,7 +195,7 @@ fz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_compressed_image int r_margin = (image->w + f - 1 - subarea->x1) >> l2factor; int b_margin = (image->h + f - 1 - subarea->y1) >> l2factor; int l_skip = (l_margin * image->n * image->bpc)/8; - int r_skip = (r_margin * image->n * image->bpc)/8; + int r_skip = (r_margin * image->n * image->bpc + 7)/8; int t_skip = t_margin * stream_stride + l_skip; int b_skip = b_margin * stream_stride + r_skip; int l = fz_skip(ctx, stm, t_skip); -- cgit v1.2.3