Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-23 18:03:04 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-07 02:51:49 +0300
commit074775462283e59657fbd18e76435371a2b80fda (patch)
treee3385e95cba3296504c93e34f38f9e2429c22bfe /libavcodec/mpeg4audio.c
parent9d36602abc4ef5b69b92feadf868c77e5e9ccc7d (diff)
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 'libavcodec/mpeg4audio.c')
-rw-r--r--libavcodec/mpeg4audio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 188d843eee..01c374fddc 100644
--- a/libavcodec/mpeg4audio.c
+++ b/libavcodec/mpeg4audio.c
@@ -42,6 +42,11 @@ static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c)
// which are buggy in old ALS conformance files
c->sample_rate = get_bits_long(gb, 32);
+ if (c->sample_rate <= 0) {
+ av_log(NULL, AV_LOG_ERROR, "Invalid sample rate %d\n", c->sample_rate);
+ return AVERROR_INVALIDDATA;
+ }
+
// skip number of samples
skip_bits_long(gb, 32);