[FFmpeg-devel] [PATCH] Deprecate av_fifo_realloc() in favour of a safer av_fifo_realloc2()

Stefano Sabatini stefano.sabatini-lala
Thu Aug 7 12:38:00 CEST 2008


On date Thursday 2008-08-07 00:58:09 +0200, Michael Niedermayer encoded:
> On Wed, Aug 06, 2008 at 12:01:32AM +0200, Stefano Sabatini wrote:
> > Hi all,
> > 
> > in the case the av_malloc() performed in av_fifo_init() inside
> > av_fifo_relloc() fails, and if the buffer in the fifo to realloc
> > contains something, the av_fifo_realloc() issues a crash.
> > 
> > Test application which reproduces the issue and my solution attached.
> > 
> > Yes the libavutil minor version bump is missing.
> [...]
> > Index: libavutil/fifo.h
> > ===================================================================
> > --- libavutil/fifo.h	(revision 14627)
> > +++ libavutil/fifo.h	(working copy)
> > @@ -97,10 +97,19 @@
> >   * Resizes an AVFifoBuffer.
> >   * @param *f AVFifoBuffer to resize
> >   * @param size new AVFifoBuffer size in bytes
> > + * @see av_fifo_realloc2()
> >   */
> > -void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
> > +attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
> >  
> 
> should be under #if VERSION < ...

Yes, if this is OK I'm also going to remove the unnecessary doxy in
fifo.c

Regards.
-- 
FFmpeg = Foolish and Freak Monstrous Portentous Exxagerate Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: implement-av-fifo-realloc2-01.patch
Type: text/x-diff
Size: 2432 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080807/0409d189/attachment.patch>



More information about the ffmpeg-devel mailing list