[Ffmpeg-devel] [PATCH] faac free extradata in encode close

Måns Rullgård mans
Thu Feb 15 02:50:15 CET 2007


Baptiste Coudurier <baptiste.coudurier at smartjog.com> writes:

> Hi
>
> $subj.
>
> Assuming it should be freed in encode_close, since it has been allocated
> in encode init, another idea ?
>
> Index: libavcodec/faac.c
> ===================================================================
> --- libavcodec/faac.c	(revision 7983)
> +++ libavcodec/faac.c	(working copy)
> @@ -115,9 +115,8 @@
>      FaacAudioContext *s = avctx->priv_data;
>  
>      av_freep(&avctx->coded_frame);
> +    av_freep(&avctx->extradata);
>  
> -    //if (avctx->extradata_size) free(avctx->extradata);
> -
>      faacEncClose(s->faac_handle);
>      return 0;
>  }

This is wrong.  The buffer was returned from faacEncGetDecoderSpecificInfo(),
and we don't know how it was allocated.  Hopefully, faacEncClose()
does the required cleanup, but I wouldn't count on it.

Have you observed a leak here?

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list