Commit 20657e05 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Improve end check

Fixes spurious end mismatch warnings
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 36241c40
......@@ -1404,8 +1404,9 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
pass_cnt ++;
}
if (cblk->data + cblk->length != t1->mqc.bp) {
av_log(s->avctx, AV_LOG_WARNING, "End mismatch %"PTRDIFF_SPECIFIER"\n", cblk->data + cblk->length - t1->mqc.bp);
if (cblk->data + cblk->length - 2*(term_cnt < cblk->nb_terminations) != t1->mqc.bp) {
av_log(s->avctx, AV_LOG_WARNING, "End mismatch %"PTRDIFF_SPECIFIER"\n",
cblk->data + cblk->length - 2*(term_cnt < cblk->nb_terminations) - t1->mqc.bp);
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment