1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

matroskadec: Pad AAC extradata.

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

CC: libav-stable@libav.org
(cherry picked from commit d2ee8c1779)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Alex Converse 2012-01-25 14:34:21 -08:00 committed by Michael Niedermayer
parent 92115bb685
commit 5af569aa30

View File

@ -1488,7 +1488,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
} else if (codec_id == CODEC_ID_AAC && !track->codec_priv.size) { } else if (codec_id == CODEC_ID_AAC && !track->codec_priv.size) {
int profile = matroska_aac_profile(track->codec_id); int profile = matroska_aac_profile(track->codec_id);
int sri = matroska_aac_sri(track->audio.samplerate); int sri = matroska_aac_sri(track->audio.samplerate);
extradata = av_malloc(5); extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
if (extradata == NULL) if (extradata == NULL)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
extradata[0] = (profile << 3) | ((sri&0x0E) >> 1); extradata[0] = (profile << 3) | ((sri&0x0E) >> 1);