[vlc-devel] [PATCH 2/2] flac: fix memory leak
Hannes Domani
ssbssa at yahoo.de
Tue Sep 2 18:49:20 CEST 2014
> Tristan Matthews <le.businessman at gmail.com> schrieb am 21:41 Montag, 1.September 2014:
>
> On Fri, Aug 29, 2014 at 12:26 PM, Hannes Domani <ssbssa at yahoo.de> wrote:
> > I'm not sure if this one is completely correct.
> >
> > In this case p_sys->p_block was allocated by block_Alloc() inside
> > ProcessHeader().
> > But I don't see when this new block is actually used, because it's
> > overwritten immediately after ProcessHeader().
> >
> > Can somebody please have a look at this?
>
> The new block is used inside ProcessHeader() (although it's not very
> obvious). FLAC__stream_decoder_process_until_end_of_metadata, invoked
> at the end of ProcessHeader(), eventually calls DecoderReadCallback,
> which uses the block. So you can free it immediately after that call.
>
> I would suggest moving this block_Release there (at the end of
> ProcessHeader) to make the connection clearer.
Here the new patch.
> Also note that the calls to block_Alloc in ProcessHeader() are not
> verified at the moment (they may return NULL), but that could be done
> in a separate patch.
It's the next one.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-flac-fix-memory-leak.patch
Type: application/octet-stream
Size: 768 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140902/657aa77b/attachment.obj>
More information about the vlc-devel
mailing list