Commit 5cccbc3b authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Check for mismatching per expected termination

not just at the end
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 68f00fb4
...@@ -1503,6 +1503,12 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, ...@@ -1503,6 +1503,12 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n"); av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n");
return AVERROR_INVALIDDATA; 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); ff_mqc_initdec(&t1->mqc, cblk->data + cblk->data_start[++term_cnt], coder_type == 2, 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