From 6d084c53a77762f41bb5310713a5f1872fef55f5 Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Fri, 29 Mar 2024 07:57:29 -0700 Subject: [PATCH] Fixes #381. Added a missing check to the jpc_dec_process_sod function of the JPC codec. Added another image to the test set. --- data/test/bad/318.jpc | Bin 0 -> 320 bytes src/libjasper/jpc/jpc_dec.c | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/test/bad/318.jpc diff --git a/data/test/bad/318.jpc b/data/test/bad/318.jpc new file mode 100644 index 0000000000000000000000000000000000000000..8446ccb36b5a6ab04b1d7621ff2f9ae9980cd047 GIT binary patch literal 320 zcmezG|38pHp8*88fLIdDf)F4+2txoPJ0leRPhj8yiLw6w_lAM-e+&b!gM)`h00jL{ zXHbRe08yxBFeA(e0-M3ez|6veX+{dr3`Xao)Wnk16osTpg*X41fXW!aR`GdwxI?Xq z11d`bD=P#m^Djt!=M|9Ru27a*RGgWgr(mRKqG#}b0@N33K#L~dhdB1LGZ#;^SAiPO>wqbm$)~zU%$&Nbbcrw#w=D+^b5y{E|Ib&pabRX%_&AicE?C literal 0 HcmV?d00001 diff --git a/src/libjasper/jpc/jpc_dec.c b/src/libjasper/jpc/jpc_dec.c index e76aa400..125a29ba 100644 --- a/src/libjasper/jpc/jpc_dec.c +++ b/src/libjasper/jpc/jpc_dec.c @@ -611,7 +611,9 @@ static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms) if (dec->pkthdrstreams) { /* Get the stream containing the packet header data for this tile-part. */ - if (!(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams, 0))) { + if (jpc_streamlist_numstreams(dec->pkthdrstreams) != 0 && + !(tile->pkthdrstream = jpc_streamlist_remove(dec->pkthdrstreams, + 0))) { return -1; } }