Skip to content

Commit

Permalink
Ensure that not all tiles lie outside the image area.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdadams committed Oct 25, 2016
1 parent e546362 commit ba2b9d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libjasper/jpc/jpc_cs.c
Expand Up @@ -508,6 +508,10 @@ static int jpc_siz_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
!siz->tileheight || !siz->numcomps || siz->numcomps > 16384) {
return -1;
}
if (siz->tilexoff >= siz->width || siz->tileyoff >= siz->height) {
jas_eprintf("all tiles are outside the image area\n");
return -1;
}
if (!(siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)))) {
return -1;
}
Expand Down
1 change: 1 addition & 0 deletions src/libjasper/jpc/jpc_dec.c
Expand Up @@ -1216,6 +1216,7 @@ static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms)
dec->tilexoff = siz->tilexoff;
dec->tileyoff = siz->tileyoff;
dec->numcomps = siz->numcomps;

if (!(dec->cp = jpc_dec_cp_create(dec->numcomps))) {
return -1;
}
Expand Down

0 comments on commit ba2b9d0

Please sign in to comment.