diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-16 19:34:20 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-16 19:34:20 +0300 |
commit | 20657e05bc2608dae03e7e8d47da11c2cdcaed38 (patch) | |
tree | 1d8621e3f10d3638b90c2a5bd9fb6cb73ea4a2b6 /libavcodec/jpeg2000dec.c | |
parent | 36241c4055411355a898920f82ac68e1506c5540 (diff) |
avcodec/jpeg2000dec: Improve end check
Fixes spurious end mismatch warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 6c86cb3d80..8eba2a3fdb 100644 --- a/libavcodec/jpeg2000dec.c +++ b/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; |