mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mpeg4audio: check the init_get_bits() return value
Fixes possible invalid reads. CC:libav-stable@libav.org
This commit is contained in:
parent
2dbd35b00c
commit
7e4e010b80
@ -80,9 +80,11 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
|||||||
int bit_size, int sync_extension)
|
int bit_size, int sync_extension)
|
||||||
{
|
{
|
||||||
GetBitContext gb;
|
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->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