Skip to content

Commit

Permalink
avcodec/j2kenc: Fix funky bpno errors on decoding
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 8166760)
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 15, 2023
1 parent e25d8a4 commit 40c0e96
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libavcodec/j2kenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 40c0e96

Please sign in to comment.