Skip to content

Commit 6d084c5

Browse files
committed
Fixes #381.
Added a missing check to the jpc_dec_process_sod function of the JPC codec. Added another image to the test set.
1 parent 6f61244 commit 6d084c5

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

data/test/bad/318.jpc

320 Bytes
Binary file not shown.

src/libjasper/jpc/jpc_dec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,9 @@ static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms)
611611
if (dec->pkthdrstreams) {
612612
/* Get the stream containing the packet header data for this
613613
tile-part. */
614-
if (!(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams, 0))) {
614+
if (jpc_streamlist_numstreams(dec->pkthdrstreams) != 0 &&
615+
!(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams,
616+
0))) {
615617
return -1;
616618
}
617619
}

0 commit comments

Comments
 (0)