[FFmpeg-cvslog] aacdec: prevent channels from exceeding MAX_CHANNELS.

Michael Niedermayer git at videolan.org
Fri Mar 23 03:28:05 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar 23 02:34:32 2012 +0100| [ba02069a8e22985a9a775dac9ece6dc54a7e8b44] | committer: Michael Niedermayer

aacdec: prevent channels from exceeding MAX_CHANNELS.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba02069a8e22985a9a775dac9ece6dc54a7e8b44
---

 libavcodec/aacdec.c |    4 ++++
 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)) {



More information about the ffmpeg-cvslog mailing list