diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-14 00:24:50 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-04 03:40:42 +0100 |
commit | f98bb0d3ec73b047121bcdf172cc809ac3c47013 (patch) | |
tree | c0096ee4e8584db6822cf2c1eadd55d995f83578 | |
parent | 346e089d25ba5f1f7509a7fbff6843471b7ccf6b (diff) | |
download | ffmpeg-f98bb0d3ec73b047121bcdf172cc809ac3c47013.tar.gz |
atrac1: validate number of channels
(cherry picked from commit bff5b2c1ca1290ea30587ff2f76171f9e3854872)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/atrac1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index 9d37e4c866..6897790307 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -336,6 +336,11 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + if (avctx->channels < 1 || avctx->channels > AT1_MAX_CHANNELS) { + av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", + avctx->channels); + return AVERROR(EINVAL); + } q->channels = avctx->channels; /* Init the mdct transforms */ |