summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-05-09 16:48:50 +0100
committerRobin Watts <robin.watts@artifex.com>2016-05-09 16:50:37 +0100
commit8b08ca2917b6230a88719cc516f791cbb6845180 (patch)
treed63bab4d1db8c935d21fc0f0ba7dd5ba60d9843d /source
parent336a0ba8fb31a674e9b2bb7e25aa672a603bb925 (diff)
downloadmupdf-8b08ca2917b6230a88719cc516f791cbb6845180.tar.xz
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.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/image.c2
1 files changed, 1 insertions, 1 deletions
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);