[Ffmpeg-cvslog] r6162 - trunk/libavcodec/vc1.c

Rich Felker dalias
Mon Sep 4 21:56:37 CEST 2006


On Mon, Sep 04, 2006 at 09:09:11PM +0200, Michael Niedermayer wrote:
> Hi
> 
> On Mon, Sep 04, 2006 at 12:04:57PM -0400, Rich Felker wrote:
> > On Mon, Sep 04, 2006 at 01:22:04PM +0200, Michael Niedermayer wrote:
> > > [...]
> > > >      /* skip B-frames if we don't have reference frames */
> > > > -    if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)) return -1;//buf_size;
> > > > +    if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)){
> > > > +        if(buf2)av_free(buf2);
> > > 
> > > the if() isnt needed, av_free(NULL) is safe, why ohh why is every single
> > > ffmpeg developer adding these checks ;)
> > 
> > Even better would be to use av_freep everywhere.. right?
> 
> maybe, iam not sure ...

well it would discourage bugs and the performance hit can't matter
since malloc/free can't be used in performance-affecting code anyway..

rich





More information about the ffmpeg-cvslog mailing list