The last patch I submitted was corrupted by an miscellaneous "k".  Sorry
about that.  This one has been tested properly (as with future patches).

README for gimp-sgoodwin-010919-0.patch

This patch fixes a bug with my previous patch (a rogue "k").  This patch should
be applied instead of the other (gimp-sgoodwin-010918-0.patch).  Apologies for the 

This patch fixes a bug with the tga loader (tga.c) reading small files.  The 
extension area described in version 2.0 of the specification is optional.  If 
the targa file does not have an extension area, the extension area offset (as 
given in the footer) has a value of 0.  Because the current code does not check
the value of the extension area offset, when the offset is 0 it reads in the the
first 495 bytes of the file regardless (this is the fixed length portion of a 
spec 2.0 targa file).  This causes problems when the file size is less than 495

Two obvious solutions are (1) check the value of the offset, and don't read the
extension area if 0, alternatively (2) remove the code so the extension area is
never read (because it is not used).  This simple patch does (1).

- Steve


Reply via email to