Skip to content

Commit

Permalink
Use return in jpc_dec_process_sot() instead of abort
Browse files Browse the repository at this point in the history
We don't need to and should not abort here.

Fix CVE-2018-9154.
Fix #215
Fix #166
Fix #175

See: #216
Fix jasper-maint/jasper#8
  • Loading branch information
jubalh committed Jun 17, 2020
1 parent cbcaf65 commit fcbabda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libjasper/jpc/jpc_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int jpc_dec_process_sot(jpc_dec_t *dec, jpc_ms_t *ms)

if (!(compinfos = jas_alloc2(dec->numcomps,
sizeof(jas_image_cmptparm_t)))) {
abort();
return -1;
}
for (cmptno = 0, cmpt = dec->cmpts, compinfo = compinfos;
cmptno < dec->numcomps; ++cmptno, ++cmpt, ++compinfo) {
Expand All @@ -512,7 +512,7 @@ static int jpc_dec_process_sot(jpc_dec_t *dec, jpc_ms_t *ms)
/* Convert the PPM marker segment data into a collection of streams
(one stream per tile-part). */
if (!(dec->pkthdrstreams = jpc_ppmstabtostreams(dec->ppmstab))) {
abort();
return -1;
}
jpc_ppxstab_destroy(dec->ppmstab);
dec->ppmstab = 0;
Expand Down

0 comments on commit fcbabda

Please sign in to comment.