Skip to content

Commit ba2b9d0

Browse files
committed
Ensure that not all tiles lie outside the image area.
1 parent e546362 commit ba2b9d0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: src/libjasper/jpc/jpc_cs.c

+4
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ static int jpc_siz_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
508508
!siz->tileheight || !siz->numcomps || siz->numcomps > 16384) {
509509
return -1;
510510
}
511+
if (siz->tilexoff >= siz->width || siz->tileyoff >= siz->height) {
512+
jas_eprintf("all tiles are outside the image area\n");
513+
return -1;
514+
}
511515
if (!(siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)))) {
512516
return -1;
513517
}

Diff for: src/libjasper/jpc/jpc_dec.c

+1
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms)
12161216
dec->tilexoff = siz->tilexoff;
12171217
dec->tileyoff = siz->tileyoff;
12181218
dec->numcomps = siz->numcomps;
1219+
12191220
if (!(dec->cp = jpc_dec_cp_create(dec->numcomps))) {
12201221
return -1;
12211222
}

0 commit comments

Comments
 (0)