[FFmpeg-devel] [PATCH] libavformat/mov.c memleak bugfix

Zdenek Kabelac zdenek.kabelac
Fri Jan 25 21:16:10 CET 2008

2008/1/25, Baptiste Coudurier <baptiste.coudurier at smartjog.com>:
> Hi,
> Zdenek Kabelac wrote:
> > Hi
> >
> > Here is a memleak patch for the allocation of MOVStreamContext in the
> > mov_read_trak.
> >
> > Also I believe it is save to check the sc pointer prior doing
> > dereference - thought I've not checked very deep if this combination
> > will never happen.
> >
> I think the free can be done in a generic way in av_close_input_stream,
> where st is freed.

But I think you cannot easily guarantee that priv_data will be always
the allocated pointer - it might be some integer value casted to void*
- or some other crazy type ??

> The null dereference should not happen, if it happens it's a bug.

Yep - I've checked the code and this case couldn't happen - so this
'if' could be ignored.


More information about the ffmpeg-devel mailing list