[FFmpeg-cvslog] avcodec/mpeg4audio: correctly propagate meaningful error values

James Almer git at videolan.org
Fri Nov 25 15:42:48 EET 2016


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Nov 25 10:40:59 2016 -0300| [50b14539158bd6d179afebb795b38be108359c4a] | committer: James Almer

avcodec/mpeg4audio: correctly propagate meaningful error values

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50b14539158bd6d179afebb795b38be108359c4a
---

 libavcodec/mpeg4audio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

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



More information about the ffmpeg-cvslog mailing list