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)