Menu ▾ ▴

#131 Tiff embedded icc profiles are overwritten before use

None
closed
None
5
2018-08-04
2018-06-01
Anonymous
No

The FIICCPROFILE returned from FreeImage_GetICCProfile for tiff images is often invalid due to it being overwritten. This doesn't seem to affect 3.17.0, only cvs. Attached is a simple patch to fix this.

1 Attachments

Discussion

  • Anonymous

    Anonymous - 2018-06-01

    Here's some code to reproduce this.

     
  • Hervé Drolon

    Hervé Drolon - 2018-07-29
    • assigned_to: Hervé Drolon
    • Group: -->
     
  • Hervé Drolon

    Hervé Drolon - 2018-07-29

    Hi,

    Do you mean that LibTIFF modify the ICC color profile while loading an image ?
    I don't understand your use-case when looking at your main.cpp file.

    Hervé

     
  • Anonymous

    Anonymous - 2018-07-30

    No, I mean that the pointer returned by FreeImage_GetICCProfile for tiffs points to uninitialized/freed/garbage memory. The main.cpp file just shows that by checking for the magic number (it isn't my actual code). I couldn't see where this happens in the source though, so the memcpy is just a basic fix. As a work around I'm now using LibTIFF 4.0.9 directly with TIFFGetField(... TIFFTAG_ICCPROFILE, ...) which works correctly.

     
  • Hervé Drolon

    Hervé Drolon - 2018-07-31

    OK,
    so since FreeImage now use LibTiff 4.0.9, I suppose we can close this bug for the next release ?
    (see https://sourceforge.net/p/freeimage/svn/HEAD/tree/FreeImage/trunk/ )
    Hervé

     
  • Anonymous

    Anonymous - 2018-08-02

    Yes, you are right, it does seem to be fixed now so it must have been a bug in LibTiff. Thanks for your help.

     
  • Hervé Drolon

    Hervé Drolon - 2018-08-04
    • status: open --> closed
     
  • Hervé Drolon

    Hervé Drolon - 2018-08-04

    fixed in release 3.18.0

     

Anonymous
Anonymous

Add attachments
Cancel