Browse Source

avcodec/jpeg2000dec: Check for mismatching per expected termination

not just at the end

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.8
Michael Niedermayer 10 years ago
parent
commit
5cccbc3b74
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/jpeg2000dec.c

+ 6
- 0
libavcodec/jpeg2000dec.c View File

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



Loading…
Cancel
Save