AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2015.11.14 13:19 "[Tiff] ColorMap and high bit depth", by Even Rouault
2015.11.14 14:33 "Re: [Tiff] ColorMap and high bit depth", by Bob Friesenhahn
2015.11.14 14:45 "Re: [Tiff] ColorMap and high bit depth", by Even Rouault
2015.11.16 13:35 "Re: [Tiff] ColorMap and high bit depth", by Even Rouault
2015.11.16 14:49 "Re: [Tiff] ColorMap and high bit depth", by Bob Friesenhahn
2015.11.16 14:56 "Re: [Tiff] ColorMap and high bit depth", by Even Rouault
2015.11.14 15:11 "Re: [Tiff] ColorMap and high bit depth", by Olivier Paquet

2015.11.14 13:19 "[Tiff] ColorMap and high bit depth", by Even Rouault

Hi,

I've noticed that currently we support ColorMap up to BitsPerSample=28. Since 3 * 2^28 * sizeof(uint16) = 1.6 GB (< 2 GB, which is the sanity check in TIFFReadDirEntryArray() ). And this is read by default at file opening, so it can be used as a sort of DoS due to excessive I/O and memory usage.

Does it make sense to support ColorMap with such high bit depths? Couldn't we limit reading ColorTable up to 24 bit for example (which would put the limit to 50 MB)? Another option would be to defer reading the color map until it is explicitly requested by the application, but do we need such complication?

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com