[FFmpeg-devel] [PATCH] Fix for memory leak in mov format

Baptiste Coudurier baptiste.coudurier
Wed Jun 4 00:24:28 CEST 2008


Art Clarke wrote:
>>>>> [...]
>>>>> Description of problem:
>>>>> The mov demuxer allocates some private data on each AVStream it adds,
>>>>> but never frees the data.
>>>>> How to reproduce:
>>>>> Use av_open_input_file() to open a .mov file, then call
>>>>> av_close_input_file().  Run program through a memory checking tool (e.g.
>>>>> valgrind).
>>>>> Description of fix:
>>>>> When closing a .mov format file, free the allocated MOVContext object
>>>>> and null the AVFormatContext->priv_data value.
> [...]
> It's been over two weeks and no one had comments on this patch (either
> rejected or accepted).  Can someone let me know if it's OK, and if so, how
> to commit it (I'd rather not keep my source tree out of sync with the tip).

Yes, sorry.

> Issue: mov format leaks memory when opening and closing a file.
> Patch: attached.

Yes, and sorry but this has been discussed already. Ideally it should be
free in av_close_input_file assuming all demuxers allocate
st->priv_data, to avoid code duplication and to be consistent with
muxing code (write trailer).

Path is ok otherwise.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA

More information about the ffmpeg-devel mailing list