summaryrefslogtreecommitdiff
path: root/libavdevice
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 /libavdevice
parent2205fb281074a31388e78c615193410cc9c10042 (diff)
libavdevice/lavfi: check avfilter_graph_dump return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavdevice')
-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 */