From e0e13b9a00093ee7cbe64356dcb4f9f64d73afc8 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 3 Jun 2017 10:58:11 +0800 Subject: jpx: Use subsampled width when reading subsampled data. This bug caused an indeterminism with issue726.j2k. --- source/fitz/load-jpx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c index e661ba2e..b03f26ce 100644 --- a/source/fitz/load-jpx.c +++ b/source/fitz/load-jpx.c @@ -823,7 +823,7 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size { int sh = sub_h[k]; int sw = sub_w[k]; - int yy = (y>>sh) * jpx->comps[k].w; + int yy = (y>>sh) * (jpx->comps[k].w >> sw); OPJ_INT32 *data = &jpx->comps[k].data[yy]; for (x = 0; x < w; x ++) { -- cgit v1.2.3