summaryrefslogtreecommitdiff
path: root/libavdevice/lavfi.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice/lavfi.c')
-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 */