Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-14 08:24:50 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 06:40:42 +0400
commitf98bb0d3ec73b047121bcdf172cc809ac3c47013 (patch)
treec0096ee4e8584db6822cf2c1eadd55d995f83578 /libavcodec
parent346e089d25ba5f1f7509a7fbff6843471b7ccf6b (diff)
atrac1: validate number of channels
(cherry picked from commit bff5b2c1ca1290ea30587ff2f76171f9e3854872) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/atrac1.c5
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 */