[libav-stable] matroskadec: Pad AAC extradata.

Alex Converse git at libav.org
Wed Jan 25 23:47:07 CET 2012


Module: libav
Branch: master
Commit: d2ee8c17793201ce969afd1f433ba1580c143cd2

Author:    Alex Converse <alex.converse at gmail.com>
Committer: Alex Converse <alex.converse at gmail.com>
Date:      Wed Jan 25 14:34:21 2012 -0800

matroskadec: Pad AAC extradata.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

CC: libav-stable at libav.org

---

 libavformat/matroskadec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e5fbd43..5b91944 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1440,7 +1440,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
         } else if (codec_id == CODEC_ID_AAC && !track->codec_priv.size) {
             int profile = matroska_aac_profile(track->codec_id);
             int sri = matroska_aac_sri(track->audio.samplerate);
-            extradata = av_malloc(5);
+            extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
             if (extradata == NULL)
                 return AVERROR(ENOMEM);
             extradata[0] = (profile << 3) | ((sri&0x0E) >> 1);



More information about the libav-stable mailing list