avcodec/jpeg2000dec: compute mask in decode_clnpass() like in decode_sigpass()

Fixes: integer overflow

Found by: Jiale Yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59367afc3d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-05-20 04:00:33 +02:00
parent 182bc42768
commit d14ea0d715
+1 -1
View File
@@ -1957,7 +1957,7 @@ static void decode_clnpass(const Jpeg2000DecoderContext *s, Jpeg2000T1Context *t
int width, int height, int bpno, int bandno,
int seg_symbols, int vert_causal_ctx_csty_symbol)
{
int mask = 3 << (bpno - 1), y0, x, y, runlen, dec;
int mask = (3u << bpno)>>1, y0, x, y, runlen, dec;
for (y0 = 0; y0 < height; y0 += 4) {
for (x = 0; x < width; x++) {