[FFmpeg-cvslog] avutil/opt: check return value of av_bprint_finalize()

Limin Wang git at videolan.org
Thu Jul 2 16:32:27 EEST 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Mon Jun 22 21:39:30 2020 +0800| [200c9b1c963c47e11f2dba37c90ef637412a3d00] | committer: Limin Wang

avutil/opt: check return value of av_bprint_finalize()

Reviewed-by:   Nicolas George <george at nsup.org>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

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

 libavutil/opt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 2c3f998d97..c8413fa5e1 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2120,6 +2120,8 @@ int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
             av_freep(&buf);
         }
     }
-    av_bprint_finalize(&bprint, buffer);
+    ret = av_bprint_finalize(&bprint, buffer);
+    if (ret < 0)
+        return ret;
     return 0;
 }



More information about the ffmpeg-cvslog mailing list