From 90312af28d34679e641ce7bd7e3e68a0db49555f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 8 Dec 2023 16:05:12 +0100 Subject: [PATCH] opj_tcd_dc_level_shift_decode(): avoid increment nullptr (fixes #1480) (likely harmless issue as we don't dereference it) --- src/lib/openjp2/tcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c index 438247b6..b2375146 100644 --- a/src/lib/openjp2/tcd.c +++ b/src/lib/openjp2/tcd.c @@ -2315,6 +2315,9 @@ static OPJ_BOOL opj_tcd_dc_level_shift_decode(opj_tcd_t *p_tcd) l_max = (OPJ_INT32)((1U << l_img_comp->prec) - 1); } + if (l_width == 0 || l_height == 0) { + continue; + } if (l_tccp->qmfbid == 1) { for (j = 0; j < l_height; ++j) { -- 2.30.2