From 304eaa63a993e9c926832b44069f6814c527d026 Mon Sep 17 00:00:00 2001 From: Jun Zhao Date: Wed, 1 Jan 2020 13:22:13 +0800 Subject: [PATCH] lavfi/buffersrc: Remove redundant free after ff_filter_frame() failure ff_filter_frame() always frees the frame in case of error, so we don't need to free the frame after ff_filter_frame() fails. Fix CID 1457230. Signed-off-by: Jun Zhao --- libavfilter/buffersrc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 64940d91e2..bf30f54177 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -240,10 +240,8 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, } ret = ff_filter_frame(ctx->outputs[0], copy); - if (ret < 0) { - av_frame_free(©); + if (ret < 0) return ret; - } if ((flags & AV_BUFFERSRC_FLAG_PUSH)) { ret = push_frame(ctx->graph);