aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-03-30 18:21:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-04-15 22:38:12 +0200
commit40c0e965c600eb40b58061b98af7a4af2c1ffbfa (patch)
treefeae72637f9e3fdfaccdeb9f20ffea910dc7bf94
parente25d8a4228dfd722f3a346368f4f36049e873b79 (diff)
downloadffmpeg-40c0e965c600eb40b58061b98af7a4af2c1ffbfa.tar.gz
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>
-rw-r--r--libavcodec/j2kenc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index a2d29aa268..e5914fe87b 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -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);