1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

mpeg4audio: correctly propagate meaningful error values

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2016-11-30 11:12:40 -03:00 committed by Vittorio Giovara
parent d82d5379ca
commit 33a2b73b98

View File

@ -33,10 +33,10 @@
static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c) static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c)
{ {
if (get_bits_left(gb) < 112) if (get_bits_left(gb) < 112)
return -1; return AVERROR_INVALIDDATA;
if (get_bits_long(gb, 32) != MKBETAG('A','L','S','\0')) if (get_bits_long(gb, 32) != MKBETAG('A','L','S','\0'))
return -1; return AVERROR_INVALIDDATA;
// override AudioSpecificConfig channel configuration and sample rate // override AudioSpecificConfig channel configuration and sample rate
// which are buggy in old ALS conformance files // which are buggy in old ALS conformance files
@ -116,8 +116,9 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
specific_config_bitindex = get_bits_count(&gb); specific_config_bitindex = get_bits_count(&gb);
if (parse_config_ALS(&gb, c)) ret = parse_config_ALS(&gb, c);
return -1; if (ret < 0)
return ret;
} }
if (c->ext_object_type != AOT_SBR && sync_extension) { if (c->ext_object_type != AOT_SBR && sync_extension) {