[FFmpeg-devel] [PATCH 2/6] avfilter/vf_paletteuse: Remove redundant freeing code

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Aug 15 21:41:41 EEST 2021


Andreas Rheinhardt:
> AVFilter.uninit is called automatically if init fails.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavfilter/vf_paletteuse.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
> index f07ef5d760..4e90927322 100644
> --- a/libavfilter/vf_paletteuse.c
> +++ b/libavfilter/vf_paletteuse.c
> @@ -1076,11 +1076,8 @@ static av_cold int init(AVFilterContext *ctx)
>  
>      s->last_in  = av_frame_alloc();
>      s->last_out = av_frame_alloc();
> -    if (!s->last_in || !s->last_out) {
> -        av_frame_free(&s->last_in);
> -        av_frame_free(&s->last_out);
> +    if (!s->last_in || !s->last_out)
>          return AVERROR(ENOMEM);
> -    }
>  
>      s->set_frame = set_frame_lut[s->color_search_method][s->dither];
>  
> 
Will apply patches 2-6 of this patchset.

- Andreas


More information about the ffmpeg-devel mailing list