diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-27 20:37:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-07 01:00:02 +0100 |
commit | c459c7b23efffab762560e41ad6a2c0dbbfd4915 (patch) | |
tree | 3e2a17257d6a9420448c8a7b3092c2b2a8d685b7 /libavcodec/aacdec.c | |
parent | 08e2c7a45f82b897a285548c257972eb1ad352c5 (diff) | |
download | ffmpeg-c459c7b23efffab762560e41ad6a2c0dbbfd4915.tar.gz |
aacdec: check channel count
Prevent out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96f452ac647dae33c53c242ef3266b65a9beafb6)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 62df283b78..34cc18bda6 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -883,6 +883,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) } } + if (avctx->channels > MAX_CHANNELS) { + av_log(avctx, AV_LOG_ERROR, "Too many channels\n"); + return AVERROR_INVALIDDATA; + } + AAC_INIT_VLC_STATIC( 0, 304); AAC_INIT_VLC_STATIC( 1, 270); AAC_INIT_VLC_STATIC( 2, 550); |