summaryrefslogtreecommitdiff
path: root/libopenjpeg/tcd.c
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-07-11 14:55:39 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-07-11 14:55:39 +0000
commit5ba8d36687e5ee61801e623bb93ff86b901e7bb7 (patch)
treecc1f7aa31a7e4c20125b89234331d1936ef51a19 /libopenjpeg/tcd.c
parent178236cc5f790bfc1b62d90d1341665b2cc770d9 (diff)
[trunk] This fixes issues seen on PDF files
Fixes issue 156
Diffstat (limited to 'libopenjpeg/tcd.c')
-rw-r--r--libopenjpeg/tcd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c
index 1fc97a80..1476bef4 100644
--- a/libopenjpeg/tcd.c
+++ b/libopenjpeg/tcd.c
@@ -796,6 +796,12 @@ void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
opj_tccp_t *tccp = &tcp->tccps[compno];
opj_tcd_tilecomp_t *tilec = &tile->comps[compno];
+ if (tccp->numresolutions <= 0)
+ {
+ cp->tileno[tileno] = -1;
+ return;
+ }
+
/* border of each tile component (global) */
tilec->x0 = int_ceildiv(tile->x0, image->comps[compno].dx);
tilec->y0 = int_ceildiv(tile->y0, image->comps[compno].dy);