[FFmpeg-cvslog] libavdevice/lavfi: check avfilter_graph_dump return value

Zhao Zhili git at videolan.org
Fri Nov 29 21:01:07 EET 2019


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Thu Nov 21 15:08:18 2019 +0800| [19956d01ccf1aca2902e8192c8768903cee3be06] | committer: Michael Niedermayer

libavdevice/lavfi: check avfilter_graph_dump return value

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavdevice/lavfi.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index ca8f05f3f7..c949ff7e12 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -302,9 +302,13 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 
     if (lavfi->dump_graph) {
         char *dump = avfilter_graph_dump(lavfi->graph, lavfi->dump_graph);
-        fputs(dump, stderr);
-        fflush(stderr);
-        av_free(dump);
+        if (dump != NULL) {
+            fputs(dump, stderr);
+            fflush(stderr);
+            av_free(dump);
+        } else {
+            FAIL(AVERROR(ENOMEM));
+        }
     }
 
     /* fill each stream with the information in the corresponding sink */



More information about the ffmpeg-cvslog mailing list