[Ffmpeg-devel] [PATCH] CRYO APC demuxer

Anssi Hannula anssi.hannula
Sat Apr 7 15:41:36 CEST 2007


Michael Niedermayer wrote:
> Hi

Hi!

> On Sat, Apr 07, 2007 at 02:37:56PM +0200, Reimar D?ffinger wrote:
> [...]

>>> +    st->codec->sample_rate = get_le32(pb);
>>> +
>>> +    st->codec->extradata_size = 2 * sizeof(int);
>>> +    st->codec->extradata = av_malloc(st->codec->extradata_size +
>>> +                                     FF_INPUT_BUFFER_PADDING_SIZE);
>>> +    if (!st->codec->extradata) {
>>> +        if (st->codec)
>>> +             av_free(st->codec);
>>> +        av_free(st);
>> Hmm... none of the other demuxers free st->codec. Actually, they just
>> ignore when they can't set extradata. No idea what is the right
>> behaviour.
> 
> they likely segfault after mem alloc failure 
> 
> 
>> But freeing st after it was registered really seems wrong to me.
> 
> yes to me too

So should I ignore extradata as well?

-- 
Anssi Hannula





More information about the ffmpeg-devel mailing list