diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-01 17:56:56 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-01-09 15:44:31 +0100 |
commit | 7e4e010b80e76862e83afbd41c25d50e72f0b44c (patch) | |
tree | c0cb0f7b97f330565158a7742ca6af3428b43987 | |
parent | 2dbd35b00c6433e587d5f44d5dbc8972ebbaa88e (diff) | |
download | ffmpeg-7e4e010b80e76862e83afbd41c25d50e72f0b44c.tar.gz |
mpeg4audio: check the init_get_bits() return value
Fixes possible invalid reads.
CC:libav-stable@libav.org
-rw-r--r-- | libavcodec/mpeg4audio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c index 0fb9b96c80..2363cb637d 100644 --- a/libavcodec/mpeg4audio.c +++ b/libavcodec/mpeg4audio.c @@ -80,9 +80,11 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int bit_size, int sync_extension) { GetBitContext gb; - int specific_config_bitindex; + int specific_config_bitindex, ret; - init_get_bits(&gb, buf, bit_size); + ret = init_get_bits(&gb, buf, bit_size); + if (ret < 0) + return ret; c->object_type = get_object_type(&gb); c->sample_rate = get_sample_rate(&gb, &c->sampling_index); c->chan_config = get_bits(&gb, 4); |