[Ffmpeg-devel] [PATCH] CRYO APC demuxer

Anssi Hannula anssi.hannula
Sat Apr 7 20:47:10 CEST 2007


Michael Niedermayer wrote:
> Hi
> 
> On Sat, Apr 07, 2007 at 09:19:51PM +0300, Anssi Hannula wrote:
> [...]
>>>> +    st->codec->extradata = av_malloc(st->codec->extradata_size +
>>>> +                                     FF_INPUT_BUFFER_PADDING_SIZE);
>>>> +    if (!st->codec->extradata) {
>>>> +        av_free(st->codec);
>>>> +        av_free(st);
>>> if you insist on this freeing stuff
>> Well IMHO it is preferred to having a memleak... Of course we could just
>> ignore the allocation failure and do not set extradata at all, avoiding
>> the freeing.
> 
> IMHO memleak is better then later calling free on a pointer stored in
> unallocated memory which will happen as soon as someone fixed
> av_open_input_stream() to do proper cleanup

Okay, attached is a patch with the freeing removed.

-- 
Anssi Hannula

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-apc_3.diff
Type: text/x-patch
Size: 5846 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070407/0b95153a/attachment.bin>



More information about the ffmpeg-devel mailing list