[Gimp-developer] tga patch fix

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

 



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

Steve
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 mistake.

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
bytes.

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
<steve@xxxxxxxxxxxxxxxxxxxx>

Attachment: gimp-sgoodwin-010919-0.patch.gz
Description: Binary data


[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux