[FFmpeg-cvslog] r11546 - in trunk: libavcodec/gif.c libavformat/gif.c

Michael Niedermayer michaelni
Thu Jan 17 03:52:22 CET 2008


On Wed, Jan 16, 2008 at 09:45:12PM -0500, Rich Felker wrote:
> On Thu, Jan 17, 2008 at 01:12:05AM +0100, michael wrote:
> > Author: michael
> > Date: Thu Jan 17 01:12:04 2008
> > New Revision: 11546
> > 
> > Log:
> > Replace idiotic (what moron wrote that code?) "buffer overflow" message by
> > abort()
> > 
> > 
> > Modified:
> >    trunk/libavcodec/gif.c
> >    trunk/libavformat/gif.c
> > 
> > Modified: trunk/libavcodec/gif.c
> > ==============================================================================
> > --- trunk/libavcodec/gif.c	(original)
> > +++ trunk/libavcodec/gif.c	Thu Jan 17 01:12:04 2008
> > @@ -136,7 +136,7 @@ static void gif_put_bits_rev(PutBitConte
> >  
> >          //printf("bitbuf = %08x\n", bit_buf);
> >          if (s->buf_ptr >= s->buf_end)
> > -            puts("bit buffer overflow !!"); // should never happen ! who got rid of the callback ???
> > +            abort();
> 
> If it can't happen, change it to assert(s->buf_ptr < s->buf_end).
> If it can happen, it needs to be handled. abort() is not a way of
> handling it.

I dont know if it can happen, but if we have a check, abort() is better then
letting the buffer overflow happen.
Why dont i check if it can happen? Because the whole code is not supposed to
be there, this is a copy and paste from some bitstream writer. Its a total
mess, and i dont volunteer to clean it up!

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080117/f21e3ff8/attachment.pgp>



More information about the ffmpeg-cvslog mailing list