[FFmpeg-devel] Small memleak when use AAC codec.

Michael Niedermayer michaelni
Fri Mar 11 13:12:13 CET 2011


On Sun, Nov 29, 2009 at 04:43:21PM +0300, Igor Makarov wrote:
> I found small memory leak when using aac. This leak is 32 bytes per loop without
> MEMALIGN_HACK, and 48 bytes with MEMALIGN.
[...]
> I tried to understand exactly where the memory is lost, and Founded that the functions
> av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx) don't free context, so if add av_free(ctx); mem leak goes away.
> 
> Patch attached.
>  psymodel.c |    1 +
>  1 file changed, 1 insertion(+)
> 642a68f3c0331e3156650fdc02421f0e0b5a78d7  psymodel.c.patch
> +++ ./libavcodec/psymodel.c     
> @@ -126,5 +126,6 @@
>          for (i = 0; i < ctx->avctx->channels; i++)
>              ff_iir_filter_free_state(ctx->fstate[i]);
>      av_freep(&ctx->fstate);
> +    av_free(ctx);
>  }

it appears this has been fixed

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110311/4df69b6d/attachment.pgp>



More information about the ffmpeg-devel mailing list