diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-27 15:12:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-27 15:22:15 +0200 |
commit | 5cccbc3b74b2f8a838b643dec6fab5bf77918e1f (patch) | |
tree | e1996157889fbd9559b2f0264bc07998b941aa58 /libavcodec | |
parent | 68f00fb40bb3cfc354f6295e8a96b07600aa72a9 (diff) | |
download | ffmpeg-streaming-5cccbc3b74b2f8a838b643dec6fab5bf77918e1f.zip ffmpeg-streaming-5cccbc3b74b2f8a838b643dec6fab5bf77918e1f.tar.gz |
avcodec/jpeg2000dec: Check for mismatching per expected termination
not just at the end
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 68dd4c0..7445942 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1503,6 +1503,12 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n"); return AVERROR_INVALIDDATA; } + if (FFABS(cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp) > 0) { + av_log(s->avctx, AV_LOG_WARNING, "Mid mismatch %"PTRDIFF_SPECIFIER" in pass %d of %d\n", + cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp, + pass_cnt, cblk->npasses); + } + ff_mqc_initdec(&t1->mqc, cblk->data + cblk->data_start[++term_cnt], coder_type == 2, 0); } |