[FFmpeg-devel] [PATCH] indeo3: remove unnecessary iv_free_func() function

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 18 07:49:35 CEST 2011



On 17 May 2011, at 22:30, Stefano Sabatini <stefano.sabatini-lala at poste.it> wrote:

> Call the freeing code directly in indeo3_decode_close(). Simplify.
> ---
> libavcodec/indeo3.c |   13 +++----------
> 1 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
> index c7ca61d..993850c 100644
> --- a/libavcodec/indeo3.c
> +++ b/libavcodec/indeo3.c
> @@ -149,13 +149,6 @@ static av_cold int iv_alloc_frames(Indeo3DecodeContext *s)
>     return 0;
> }
> 
> -static av_cold void iv_free_func(Indeo3DecodeContext *s)
> -{
> -    av_freep(&s->buf);
> -    av_freep(&s->ModPred);
> -    av_freep(&s->corrector_type);
> -}
> -
> struct ustr {
>     int xpos;
>     int ypos;
> @@ -979,8 +972,6 @@ static av_cold int indeo3_decode_init(AVCodecContext *avctx)
> 
>     if (!(ret = build_modpred(s)))
>         ret = iv_alloc_frames(s);
> -    if (ret)
> -        iv_free_func(s);
> 
>     return ret;
> }

Huh? I don't think decode_end is called if init fails.


More information about the ffmpeg-devel mailing list