GNOME Bugzilla – Bug 122710
Redundant comparison in io-tga.c
Last modified: 2010-07-10 04:04:07 UTC
I got this warning from gcc: io-tga.c: In function `try_preload': io-tga.c:720: warning: comparison is always false due to limited range of data type and it seems the compiler is right. The code is checking if a struct member declared as guint8 is bigger than 255 here: 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; }
Same thing happens on line 931: if (hdr->infolen > 255) { g_set_error(err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Too big value in the infolen field of TGA header.")); g_free(hdr); return NULL; }
Fixed on HEAD.