diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-05-09 16:48:50 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-05-09 16:50:37 +0100 |
commit | 8b08ca2917b6230a88719cc516f791cbb6845180 (patch) | |
tree | d63bab4d1db8c935d21fc0f0ba7dd5ba60d9843d /source/fitz | |
parent | 336a0ba8fb31a674e9b2bb7e25aa672a603bb925 (diff) | |
download | mupdf-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/fitz')
-rw-r--r-- | source/fitz/image.c | 2 |
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); |