summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-23 02:34:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-23 03:08:58 +0100
commitba02069a8e22985a9a775dac9ece6dc54a7e8b44 (patch)
treef7e14f3efb20c9de6d6025472d36161a330ff25b
parent01fd1aa0ad2b95045df35f94ee9de073d24609c8 (diff)
downloadffmpeg-streaming-ba02069a8e22985a9a775dac9ece6dc54a7e8b44.zip
ffmpeg-streaming-ba02069a8e22985a9a775dac9ece6dc54a7e8b44.tar.gz
aacdec: prevent channels from exceeding MAX_CHANNELS.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/aacdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index f0ed667..7c3d43a 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -149,6 +149,10 @@ static av_cold int che_configure(AACContext *ac,
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
}
if (type != TYPE_CCE) {
+ if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->m4ac.ps == 1))) {
+ av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
+ return AVERROR_INVALIDDATA;
+ }
ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret;
if (type == TYPE_CPE ||
(type == TYPE_SCE && ac->m4ac.ps == 1)) {
OpenPOWER on IntegriCloud