summaryrefslogtreecommitdiff
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-23 17:03:04 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-07 00:51:49 +0100
commit074775462283e59657fbd18e76435371a2b80fda (patch)
treee3385e95cba3296504c93e34f38f9e2429c22bfe /libavformat/isom.c
parent9d36602abc4ef5b69b92feadf868c77e5e9ccc7d (diff)
downloadffmpeg-074775462283e59657fbd18e76435371a2b80fda.tar.gz
mpeg4audio: validate sample_rate
A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. Also check for errors from avpriv_mpeg4audio_get_config in ff_mp4_read_dec_config_descr. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index ab79e226e5..1fa46bdab2 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -513,8 +513,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
return ret;
if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
MPEG4AudioConfig cfg = {0};
- avpriv_mpeg4audio_get_config(&cfg, st->codecpar->extradata,
- st->codecpar->extradata_size * 8, 1);
+ ret = avpriv_mpeg4audio_get_config(&cfg, st->codecpar->extradata,
+ st->codecpar->extradata_size * 8, 1);
+ if (ret < 0)
+ return ret;
st->codecpar->channels = cfg.channels;
if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
st->codecpar->sample_rate = avpriv_mpa_freq_tab[cfg.sampling_index];