mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
96f452ac64
commit
deefdf9788
@ -84,10 +84,8 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
|||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int specific_config_bitindex;
|
int specific_config_bitindex;
|
||||||
|
|
||||||
if(bit_size<=0)
|
if (bit_size <= 0 || init_get_bits(&gb, buf, bit_size) < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
init_get_bits(&gb, buf, bit_size);
|
|
||||||
c->object_type = get_object_type(&gb);
|
c->object_type = get_object_type(&gb);
|
||||||
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
|
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
|
||||||
c->chan_config = get_bits(&gb, 4);
|
c->chan_config = get_bits(&gb, 4);
|
||||||
|
Loading…
Reference in New Issue
Block a user