From: headshog Date: Wed, 6 Dec 2023 14:57:41 +0000 (+0300) Subject: opj_t1_ht_decode_cblk(): avoid memcpy() with 0-input size and nullptr destination... X-Git-Tag: v2.5.1~12^2 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=478b20d9234d6f856cbb4a2a67ee858dc99293d5;p=openjpeg.git opj_t1_ht_decode_cblk(): avoid memcpy() with 0-input size and nullptr destination. fix ht_dec.c:1215 (#1492) --- diff --git a/src/lib/openjp2/ht_dec.c b/src/lib/openjp2/ht_dec.c index 120d7e49..9ea061f3 100644 --- a/src/lib/openjp2/ht_dec.c +++ b/src/lib/openjp2/ht_dec.c @@ -1210,6 +1210,9 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1, /* Concatenate all chunks */ cblkdata = t1->cblkdatabuffer; + if (cblkdata == NULL) { + return OPJ_FALSE; + } cblk_len = 0; for (i = 0; i < cblk->numchunks; i++) { memcpy(cblkdata + cblk_len, cblk->chunks[i].data, cblk->chunks[i].len);