summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-15 20:29:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-15 20:49:04 +0200
commit2819aeb0f3c2ecd6c397534655defe551874f3be (patch)
tree61d777b676efa76cdcb49a876fe4459093ab86ae /libavcodec/jpeg2000dec.c
parentd107413f1caf49b193e6a714fe145fda40b586a8 (diff)
avcodec/jpeg2000dec: Omit mqc reinit after the last pass
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 61e4dfdd0d..a2862bd6dc 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1388,8 +1388,8 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
if (codsty->cblk_style & JPEG2000_CBLK_RESET) // XXX no testcase for just this
ff_mqc_init_contexts(&t1->mqc);
- if ((coder_type = needs_termination(codsty->cblk_style, pass_cnt))) {
- if (term_cnt >= cblk->nb_terminations) {
+ if (passno && (coder_type = needs_termination(codsty->cblk_style, pass_cnt))) {
+ if (term_cnt > cblk->nb_terminations) {
av_log(s->avctx, AV_LOG_ERROR, "Missing needed termination \n");
return AVERROR_INVALIDDATA;
}