From 94b155e49bdefcfe3117759e55bb1d40e655eb9e Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 1 Oct 2019 14:55:43 +0200 Subject: [PATCH] avfilter/copy: add forgotten check --- libavfilter/af_acopy.c | 4 +++- libavfilter/vf_copy.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_acopy.c b/libavfilter/af_acopy.c index a7caec6ae9..2d915019db 100644 --- a/libavfilter/af_acopy.c +++ b/libavfilter/af_acopy.c @@ -26,8 +26,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples); int ret; - if (!out) + if (!out) { ret = AVERROR(ENOMEM); + goto fail; + } ret = av_frame_copy_props(out, in); if (ret < 0) diff --git a/libavfilter/vf_copy.c b/libavfilter/vf_copy.c index a59e024e87..e82feb4f0e 100644 --- a/libavfilter/vf_copy.c +++ b/libavfilter/vf_copy.c @@ -50,8 +50,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height); int ret; - if (!out) + if (!out) { ret = AVERROR(ENOMEM); + goto fail; + } ret = av_frame_copy_props(out, in); if (ret < 0)