[FFmpeg-devel] [PATCH] mov: Fix memory leaks on aborted header parsing.

Michael Niedermayer michaelni at gmx.at
Fri Apr 13 19:56:40 CEST 2012

On Fri, Apr 13, 2012 at 10:06:53AM -0700, Dale Curtis wrote:
> On Fri, Apr 13, 2012 at 3:10 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
> > On Thu, Apr 12, 2012 at 05:50:55PM -0700, dalecurtis at chromium.org wrote:
> > > From: Dale Curtis <dalecurtis at chromium.org>
> > >
> > > If mov_read_header exits under error, the memory allocated is
> > > not freed.
> > >
> > > Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
> >
> > i wonder if we can simply call the close for all demuxers in utils.c,
> > as this likely affects more demuxers
> > but until thats tested and investigated, ill apply this patch.
> >
> > thanks
> >
> >
> FWIW, closing for all demuxers in utils was the patch I made locally for
> Chrome last time, I ran into several double-free's just in the codecs we
> are using though so never tried to upstream it.

I dont doubt that, but i think we should fix these double frees
either way, independant of where and how the closing is done. Its
bad practice to leave freed pointers laying around.

> All the leaks that method
> fixed seem fixed elsewhere in master now.

i suspect that many less used exit pathes of less used demuxers
still leak.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120413/b689b675/attachment.asc>

More information about the ffmpeg-devel mailing list