History

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.

Andreas Rheinhardt committed 6 years ago

Commit 358c0bb1 parent aa262dc1 file · +3 −12Browse files

Unified · Split

libavfilter/vf_minterpolate.c+3−12
@@ -340,7 +340,7 @@ static int config_input(AVFilterLink *inlink) · 339 unmodified lines
340340 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
341341 const int height = inlink->h;
342342 const int width = inlink->w;
343− int i, ret = 0;
343+ int i;
344344
345345 mi_ctx->log2_chroma_h = desc->log2_chroma_h;
346346 mi_ctx->log2_chroma_w = desc->log2_chroma_w;
@@ -380,10 +380,8 @@ static int config_input(AVFilterLink *inlink) · 33 unmodified lines
380380 mi_ctx->pixel_mvs = av_mallocz_array(width * height, sizeof(PixelMVS));
381381 mi_ctx->pixel_weights = av_mallocz_array(width * height, sizeof(PixelWeights));
382382 mi_ctx->pixel_refs = av_mallocz_array(width * height, sizeof(PixelRefs));
383− if (!mi_ctx->pixel_mvs || !mi_ctx->pixel_weights || !mi_ctx->pixel_refs) {
384− ret = AVERROR(ENOMEM);
385− goto fail;
386− }
383+ if (!mi_ctx->pixel_mvs || !mi_ctx->pixel_weights || !mi_ctx->pixel_refs)
384+ return AVERROR(ENOMEM);
387385
388386 if (mi_ctx->me_mode == ME_MODE_BILAT)
389387 if (!(mi_ctx->int_blocks = av_mallocz_array(mi_ctx->b_count, sizeof(Block))))
@@ -405,13 +403,6 @@ static int config_input(AVFilterLink *inlink) · 15 unmodified lines
405403 }
406404
407405 return 0;
408−fail:
409− for (i = 0; i < NB_FRAMES; i++)
410− av_freep(&mi_ctx->frames[i].blocks);
411− av_freep(&mi_ctx->pixel_mvs);
412− av_freep(&mi_ctx->pixel_weights);
413− av_freep(&mi_ctx->pixel_refs);
414− return ret;
415406 }
416407
417408 static int config_output(AVFilterLink *outlink)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t