[FFmpeg-cvslog] avfilter/vf_minterpolate: Remove redundant code for freeing
Andreas Rheinhardt
git at videolan.org
Fri Oct 9 18:09:50 EEST 2020
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Tue Oct 6 15:10:43 2020 +0200| [358c0bb168aa00fce3075954a0932a1be6d04347] | committer: Andreas Rheinhardt
avfilter/vf_minterpolate: Remove redundant code for freeing
ad73b32d2922f4237405043d19763229aee0e59e added some code for freeing in
the input's config_props function, yet this is unnecessary as uninit is
called anyway if config_props fails.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=358c0bb168aa00fce3075954a0932a1be6d04347
---
libavfilter/vf_minterpolate.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index bf45662913..969463f021 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -340,7 +340,7 @@ static int config_input(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
const int height = inlink->h;
const int width = inlink->w;
- int i, ret = 0;
+ int i;
mi_ctx->log2_chroma_h = desc->log2_chroma_h;
mi_ctx->log2_chroma_w = desc->log2_chroma_w;
@@ -380,10 +380,8 @@ static int config_input(AVFilterLink *inlink)
mi_ctx->pixel_mvs = av_mallocz_array(width * height, sizeof(PixelMVS));
mi_ctx->pixel_weights = av_mallocz_array(width * height, sizeof(PixelWeights));
mi_ctx->pixel_refs = av_mallocz_array(width * height, sizeof(PixelRefs));
- if (!mi_ctx->pixel_mvs || !mi_ctx->pixel_weights || !mi_ctx->pixel_refs) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
+ if (!mi_ctx->pixel_mvs || !mi_ctx->pixel_weights || !mi_ctx->pixel_refs)
+ return AVERROR(ENOMEM);
if (mi_ctx->me_mode == ME_MODE_BILAT)
if (!(mi_ctx->int_blocks = av_mallocz_array(mi_ctx->b_count, sizeof(Block))))
@@ -405,13 +403,6 @@ static int config_input(AVFilterLink *inlink)
}
return 0;
-fail:
- for (i = 0; i < NB_FRAMES; i++)
- av_freep(&mi_ctx->frames[i].blocks);
- av_freep(&mi_ctx->pixel_mvs);
- av_freep(&mi_ctx->pixel_weights);
- av_freep(&mi_ctx->pixel_refs);
- return ret;
}
static int config_output(AVFilterLink *outlink)
More information about the ffmpeg-cvslog
mailing list