[FFmpeg-cvslog] atrac1: validate number of channels
Justin Ruggles
git at videolan.org
Fri Nov 4 20:49:30 CET 2011
ffmpeg | branch: release/0.7 | Justin Ruggles <justin.ruggles at gmail.com> | Fri Oct 14 00:24:50 2011 -0400| [f98bb0d3ec73b047121bcdf172cc809ac3c47013] | committer: Michael Niedermayer
atrac1: validate number of channels
(cherry picked from commit bff5b2c1ca1290ea30587ff2f76171f9e3854872)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f98bb0d3ec73b047121bcdf172cc809ac3c47013
---
libavcodec/atrac1.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 9d37e4c..6897790 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 */
More information about the ffmpeg-cvslog
mailing list