diff mbox series

[FFmpeg-devel,3/6] avformat/au: check return value of av_bprint_finalize()

Message ID 1592839474-2804-3-git-send-email-lance.lmwang@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/6] avutil/opt: check return value of av_bprint_finalize()
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Limin Wang June 22, 2020, 3:24 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/au.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Nicolas George June 24, 2020, 3:38 p.m. UTC | #1
lance.lmwang@gmail.com (12020-06-22):
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/au.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Probably ok, buy I do not maintain this.

Regards,
diff mbox series

Patch

diff --git a/libavformat/au.c b/libavformat/au.c
index 4afee85..ff9176a 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -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 {