summaryrefslogtreecommitdiff
path: root/libavcodec/atrac1.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-14 00:24:50 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-10-29 15:06:31 -0400
commitbff5b2c1ca1290ea30587ff2f76171f9e3854872 (patch)
treed9a164d828afab1d45be3672d43d00f5de0c9420 /libavcodec/atrac1.c
parent9a35ff384124a08209a8ee5355fdec93440d0e37 (diff)
atrac1: validate number of channels
Diffstat (limited to 'libavcodec/atrac1.c')
-rw-r--r--libavcodec/atrac1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 4647e0c351..1ba580cbac 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -332,6 +332,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 */