From cc752233fb83df53c55fc9b3d12b9ffc6df124d9 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 14 Jan 2020 16:43:45 +0100 Subject: [PATCH] avfilter/f_ebur128: check if frame clone is set --- libavfilter/f_ebur128.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index f25d5f096e..31b75ab097 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -774,6 +774,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) /* push one video frame */ if (ebur128->do_video) { + AVFrame *clone; int x, y, ret; uint8_t *p; double gauge_value; @@ -823,7 +824,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) /* set pts and push frame */ pic->pts = pts; - ret = ff_filter_frame(outlink, av_frame_clone(pic)); + clone = av_frame_clone(pic); + if (!clone) + return AVERROR(ENOMEM); + ret = ff_filter_frame(outlink, clone); if (ret < 0) return ret; }