[FFmpeg-devel] [PATCH] fix h264 decoder memory leak

Mike Scheutzow scheutzow
Fri Nov 13 15:47:24 CET 2009

Michael Niedermayer wrote:
> On Thu, Nov 12, 2009 at 09:52:07AM -0500, Mike Scheutzow wrote:
>> The attached patch fixes a memory leak in libavcodec/h264.c. Two buffers 
>> were still allocated after the h264 decoder is closed.
> there is code a few lines later that is supposed to free them
> also rbsp_buffer_size should be reset

This memory leak occurs when free_tables() is called from 
av_parser_close(). In that situation, h->thread_context[0] is NULL.

h264-mem-leak-v2.patch is attached, which also zeros rbsp_buffer_size[] 
as requested.

Mike Scheutzow
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: h264-mem-leak-v2.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091113/dfe9d947/attachment.txt>

More information about the ffmpeg-devel mailing list