diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2019-11-21 15:08:18 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-29 19:58:35 +0100 |
commit | 19956d01ccf1aca2902e8192c8768903cee3be06 (patch) | |
tree | 3d3a565579ebf83b2829f31eaf6513889660cfdf | |
parent | 2205fb281074a31388e78c615193410cc9c10042 (diff) | |
download | ffmpeg-19956d01ccf1aca2902e8192c8768903cee3be06.tar.gz |
libavdevice/lavfi: check avfilter_graph_dump return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavdevice/lavfi.c | 10 |
1 files 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 */ |