avcodec/jpeg2000dec: Improve end check

Fixes spurious end mismatch warnings

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/138/head
Michael Niedermayer 10 years ago
parent 36241c4055
commit 20657e05bc
  1. 5
      libavcodec/jpeg2000dec.c

@ -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;

Loading…
Cancel
Save