diff --git a/ChangeLog b/ChangeLog index 7f0afdeaa3..6c997510fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-08-02 Sven Neumann + + * plug-ins/common/tga.c: merged fix for small TGA2 files by + Nick Lamb from the stable branch. + 2001-08-01 Sven Neumann * app/docindex.c diff --git a/plug-ins/common/tga.c b/plug-ins/common/tga.c index d9604b51c8..00f292c696 100644 --- a/plug-ins/common/tga.c +++ b/plug-ins/common/tga.c @@ -441,13 +441,15 @@ load_image (gchar *filename) offset= footer[0] + (footer[1] * 256) + (footer[2] * 65536) + (footer[3] * 16777216); - if (fseek (fp, offset, SEEK_SET) || - fread (extension, sizeof (extension), 1, fp) != 1) { - g_message (_("TGA: Cannot read extension from \"%s\"\n"), filename); - return -1; + if (offset != 0) { + if (fseek (fp, offset, SEEK_SET) || + fread (extension, sizeof (extension), 1, fp) != 1) { + g_message (_("TGA: Cannot read extension from \"%s\"\n"), filename); + return -1; + } + /* Eventually actually handle version 2 TGA here */ } - /* Eventually actually handle version 2 TGA here */ } }