X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavdevice%2Flavfi.c;h=c949ff7e12472f046fb7c39e7cdcb5a2d5fc4e5a;hb=12bbfc4ccaa150e06895691049fa2ea33385d210;hp=ca8f05f3f72368ee76b8e0333d3567dc13bb27cd;hpb=2d62e06ff6a9f3dbd78136c1dc4a315a727c6f00;p=ffmpeg diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index ca8f05f3f72..c949ff7e124 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 */