avcodec/j2kenc: Fix funky bpno errors on decoding

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 816676085e3d32f27d4001d9b95590046c487eb6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-03-30 18:21:28 +02:00
parent e25d8a4228
commit 40c0e965c6
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -658,11 +658,10 @@ static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg20
if (max == 0){
cblk->nonzerobits = 0;
bpno = 0;
} else{
cblk->nonzerobits = av_log2(max) + 1 - NMSEDEC_FRACBITS;
bpno = cblk->nonzerobits - 1;
}
bpno = cblk->nonzerobits - 1;
cblk->data[0] = 0;
ff_mqc_initenc(&t1->mqc, cblk->data + 1);