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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -340,7 +340,7 @@ static int config_input(AVFilterLink *inlink) · 339 unmodified lines | ||
| 340 | 340 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); |
| 341 | 341 | const int height = inlink->h; |
| 342 | 342 | const int width = inlink->w; |
| 343 | − int i, ret = 0; | |
| 343 | + int i; | |
| 344 | 344 | |
| 345 | 345 | mi_ctx->log2_chroma_h = desc->log2_chroma_h; |
| 346 | 346 | mi_ctx->log2_chroma_w = desc->log2_chroma_w; |
| @@ -380,10 +380,8 @@ static int config_input(AVFilterLink *inlink) · 33 unmodified lines | ||
| 380 | 380 | mi_ctx->pixel_mvs = av_mallocz_array(width * height, sizeof(PixelMVS)); |
| 381 | 381 | mi_ctx->pixel_weights = av_mallocz_array(width * height, sizeof(PixelWeights)); |
| 382 | 382 | 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); | |
| 387 | 385 | |
| 388 | 386 | if (mi_ctx->me_mode == ME_MODE_BILAT) |
| 389 | 387 | 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 | ||
| 405 | 403 | } |
| 406 | 404 | |
| 407 | 405 | 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; | |
| 415 | 406 | } |
| 416 | 407 | |
| 417 | 408 | static int config_output(AVFilterLink *outlink) |