Re: Strangely useless code in io-tga.c, part of gdk-pixbuf



On Sat, 2004-04-17 at 13:35, Chris Sherlock wrote:
> I was looking through gdk-pixbuf and I found something odd. In io-tga.c, 
> there's the following code snippet:
> 
> if (ctx->hdr->infolen > 255) {
>    g_set_error(err, GDK_PIXBUF_ERROR,
>                     GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
>                     _("TGA image comment length is too long"));
>    return FALSE;
> }
> 
> I don't get it! infolen is an element of _TGAHeader, and is declared as 
> a guint8. Isn't guint8 *gauranteed* to be an unsigned integer that's one 
> byte long?
> 
> If this is the case, this code check really isn't needed... so why is it 
> in there?

It's already fixed.  You must be looking at a rather old version of
GTK+.

http://bugzilla.gnome.org/show_bug.cgi?id=122710

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]