[FFmpeg-devel] 0001-Fix-packet_buffer-memory-leak-in-avformat_free_conte.patch

Michael Niedermayer michaelni at gmx.at
Fri Aug 15 19:58:26 CEST 2014


On Fri, Aug 15, 2014 at 05:46:37PM +0300, Andrey Myznikov wrote:
> Hello,
> 
>     Attached path fixes potential memory leak in output format
> context when av_interleaved_write_frame() is used.
> This function can use AVFormatContext.packet_buffer for packet
> ordering, but this buffer is not feed later in
> avformat_free_context().
> The Valgrind utiluty clearly shows this leak.
> 
> Note polease that when closing input context with
> avformat_close_input(AVFormatContext **ps) , the packet_buffer is
> correctly freed by flush_packet_queue(s) ->
> free_packet_buffer(&s->packet_buffer, &s->packet_buffer_end). But
> free_packet_buffer() is declared as static in utils.c and can not be
> called directly from application code.
> 
> So, I propose to add this call into avformat_free_context() to avoid
> memory leaks on output.
> 
> Regards,
>     Andrey Myznikov
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

>  utils.c |    1 +
>  1 file changed, 1 insertion(+)
> 9260264a92287931471e7c1c1c21473ee2cc04bd  0001-Fix-packet_buffer-memory-leak-in-avformat_free_conte.patch
> From 9d836666000821da8bbe1d0114c61f2dc703ea65 Mon Sep 17 00:00:00 2001
> From: Andrey Myznikov <andrey.myznikov at gmail.com>
> Date: Fri, 15 Aug 2014 17:25:15 +0300
> Subject: [PATCH] Fix packet_buffer memory leak in avformat_free_context

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140815/9e3978f9/attachment.asc>


More information about the ffmpeg-devel mailing list