]> git.sesse.net Git - ffmpeg/commitdiff
avformat/au: check return value of av_bprint_finalize()
authorLimin Wang <lance.lmwang@gmail.com>
Mon, 22 Jun 2020 13:49:30 +0000 (21:49 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Thu, 2 Jul 2020 13:12:37 +0000 (21:12 +0800)
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavformat/au.c

index 4afee85a948e3a1787efd42457e05395a8724bd4..ff9176a1f15867ed82857b7e898183a5051ddb24 100644 (file)
@@ -81,7 +81,7 @@ static int au_read_annotation(AVFormatContext *s, int size)
     AVBPrint bprint;
     char * key = NULL;
     char * value = NULL;
-    int i;
+    int ret, i;
 
     av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
 
@@ -92,7 +92,9 @@ static int au_read_annotation(AVFormatContext *s, int size)
             if (c == '\0') {
                 state = PARSE_FINISHED;
             } else if (c == '=') {
-                av_bprint_finalize(&bprint, &key);
+                ret = av_bprint_finalize(&bprint, &key);
+                if (ret < 0)
+                    return ret;
                 av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
                 state = PARSE_VALUE;
             } else {