aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2019-11-21 15:08:18 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-29 19:58:35 +0100
commit19956d01ccf1aca2902e8192c8768903cee3be06 (patch)
tree3d3a565579ebf83b2829f31eaf6513889660cfdf
parent2205fb281074a31388e78c615193410cc9c10042 (diff)
downloadffmpeg-19956d01ccf1aca2902e8192c8768903cee3be06.tar.gz
libavdevice/lavfi: check avfilter_graph_dump return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavdevice/lavfi.c10
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 */