From fd095539d10bb440042e671f95306b16b0fec674 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 21 Oct 2011 17:25:30 +0200 Subject: latmdec: fix audio specific config parsing Pass the correct size in bits to mpeg4audio_get_config and add a flag to disable parsing of the sync extension when the size is not known. Latm with AudioMuxVersion 0 does not specify the size of the audio specific config. Data after the audio specific config can be misinterpreted as sync extension resulting in random and wrong configs. --- libavformat/flvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/flvdec.c') diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 5d19dd8413..51a8126904 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -534,7 +534,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) if (st->codec->codec_id == CODEC_ID_AAC) { MPEG4AudioConfig cfg; avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata, - st->codec->extradata_size); + st->codec->extradata_size * 8, 1); st->codec->channels = cfg.channels; if (cfg.ext_sample_rate) st->codec->sample_rate = cfg.ext_sample_rate; -- cgit v1.2.3