aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-27 20:37:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-17 23:22:44 +0100
commite6ac11e41734cbb24ec5e6c73264d030e5f07a64 (patch)
tree7c86477aa14e8bcccb01f0bc361dc56fb77f04b0
parent2cac35086c9e103fa98960c546d5017e7363803a (diff)
downloadffmpeg-e6ac11e41734cbb24ec5e6c73264d030e5f07a64.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>
-rw-r--r--libavcodec/aacdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index a0f5344bee..78176d0053 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -568,6 +568,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
output_scale_factor = 1.0;
}
+ 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);