summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-27 20:37:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-27 20:38:00 +0100
commit96f452ac647dae33c53c242ef3266b65a9beafb6 (patch)
tree38f4e797e93f13215219c6b3a1244394f48c9fb6 /libavcodec
parent9d602a0b0e955ac8553b16fc1b98731d66fdde2b (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 235ea4670c..49e9b60f44 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -914,6 +914,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);