aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-20 18:40:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-21 17:05:16 +0100
commitca5d6c615e505bc84fe698650b4ddbd80229eb59 (patch)
tree7d8bd3b4fb9f2363de9b784a107bc0bf1848364c
parent7c17207ab9acfaa934e8feb8fba90765c9d0b989 (diff)
downloadffmpeg-ca5d6c615e505bc84fe698650b4ddbd80229eb59.tar.gz
avcodec/jpeg2000dec: fix error detection in pix_fmt_match()
Fixes out of array accesses with CODEC_FLAG_EMU_EDGE Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 8001e9f7d17e90b4b0898ba64e3b8bbd716c513c) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/jpeg2000dec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index d70413a0da..5231040494 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -344,7 +344,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
break;
}
}
- if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) {
+ if (i == possible_fmts_nb) {
av_log(s->avctx, AV_LOG_ERROR,
"Unknown pix_fmt, profile: %d, colour_space: %d, "
"components: %d, precision: %d, "
@@ -354,6 +354,7 @@ static int get_siz(Jpeg2000DecoderContext *s)
ncomponents > 2 ? s->cdy[1] : 0,
ncomponents > 2 ? s->cdx[2] : 0,
ncomponents > 2 ? s->cdy[2] : 0);
+ return AVERROR_PATCHWELCOME;
}
return 0;
}