[Ffmpeg-devel] [PATCH] Redundant memset

Michael Niedermayer michaelni
Sat Sep 9 00:27:52 CEST 2006


Hi

On Fri, Sep 08, 2006 at 10:35:06AM -0400, Rich Felker wrote:
> On Fri, Sep 08, 2006 at 10:32:27AM +0200, Michael Niedermayer wrote:
> > Hi
> > 
> > On Fri, Sep 08, 2006 at 10:11:22AM +0200, Panagiotis Issaris wrote:
> > > Hi,
> > > 
> > > The attached patch removes a redundant memset from libavformat. The memory is
> > > cleared with memset although it had been previously allocated with av_mallocz
> > > and thus was already cleared. The function avformat_get_context_defaults()
> > > is only used from av_alloc_format_context().
> > 
> > if so then id say add a static under
> > #if LIBAVCODEC_VERSION_INT > ...
> > so it dissapears when we next do a compatibility breaking change
> 
> Isn't it supposed to be possible for the caller to setup the struct
> without asking lavf to allocate it?

no, for what would that be usefull? also the struct size might differ between
lavf versions not that that would make it impossible to do it outside but
i somehow feel that many would misstakely write *malloc(sizeof(...)) instead of
malloc(av_context_size) if allocation outside lavf could be used

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list