From 1a1825132faaa7a4560d395bc34a4cc1c7dff456 Mon Sep 17 00:00:00 2001 From: headshog Date: Wed, 6 Dec 2023 17:21:02 +0300 Subject: [PATCH] opj_t1_decode_cblk(): detech unsigned-interger-overflow at t1.c:1989 (#1489) --- src/lib/openjp2/t1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 52e466eb9..428430db9 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -1987,6 +1987,9 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1, } bpno_plus_one = (OPJ_INT32)(roishift + cblk->numbps); + if ((OPJ_UINT32)bpno_plus_one < cblk->numbps) { + return OPJ_FALSE; + } if (bpno_plus_one >= 31) { if (p_manager_mutex) { opj_mutex_lock(p_manager_mutex);