From: Michael Niedermayer Date: Tue, 16 Jun 2015 16:31:59 +0000 (+0200) Subject: avcodec/jpeg2000dec: Fix term_cnt check X-Git-Tag: n2.8~1597 X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=36241c4055411355a898920f82ac68e1506c5540;ds=sidebyside avcodec/jpeg2000dec: Fix term_cnt check Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index d64a7b5f0b..6c86cb3d80 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1389,7 +1389,7 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, ff_mqc_init_contexts(&t1->mqc); if (passno && (coder_type = needs_termination(codsty->cblk_style, pass_cnt))) { - if (term_cnt > cblk->nb_terminations) { + if (term_cnt >= cblk->nb_terminations) { av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n"); return AVERROR_INVALIDDATA; }