aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-27 21:17:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-27 21:18:00 +0100
commitdeefdf9788467edd262b9c29a4f6e33d2ae84b8c (patch)
treedbc645cd8b77b3480fde737ff07995b358a7d943 /libavcodec
parent96f452ac647dae33c53c242ef3266b65a9beafb6 (diff)
downloadffmpeg-deefdf9788467edd262b9c29a4f6e33d2ae84b8c.tar.gz
avpriv_mpeg4audio_get_config: check init_get_bits() return code.
Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4audio.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 8aa3219207..68448e6fa2 100644
--- a/libavcodec/mpeg4audio.c
+++ b/libavcodec/mpeg4audio.c
@@ -84,10 +84,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
GetBitContext gb;
int specific_config_bitindex;
- if(bit_size<=0)
+ if (bit_size <= 0 || init_get_bits(&gb, buf, bit_size) < 0)
return AVERROR_INVALIDDATA;
-
- init_get_bits(&gb, buf, bit_size);
c->object_type = get_object_type(&gb);
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
c->chan_config = get_bits(&gb, 4);