AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2018.04.23 16:00 "[Tiff] libTiff Bug", by SM
2018.04.23 16:08 "Re: [Tiff] libTiff Bug", by Bob Friesenhahn
2018.04.24 20:18 "Re: [Tiff] libTiff Bug", by SM
2018.04.24 18:23 "Re: [Tiff] libTiff Bug", by SM
2018.04.24 18:35 "Re: [Tiff] libTiff Bug", by Even Rouault
2018.04.24 19:04 "Re: [Tiff] libTiff Bug", by Bob Friesenhahn
2018.04.24 20:14 "Re: [Tiff] libTiff Bug", by SM
2018.04.24 20:30 "Re: [Tiff] libTiff Bug", by Roger Leigh
2018.04.23 16:17 "Re: [Tiff] libTiff Bug", by Even Rouault
2018.04.23 16:29 "Re: [Tiff] libTiff Bug", by SM
2018.04.23 16:41 "Re: [Tiff] libTiff Bug", by SM
2018.04.23 19:11 "Re: [Tiff] libTiff Bug", by SM
2018.04.23 19:14 "Re: [Tiff] libTiff Bug", by Bob Friesenhahn

2018.04.24 19:04 "Re: [Tiff] libTiff Bug", by Bob Friesenhahn

That's still not correct. The widening to uint64 occurs after the multiplication which is done on uint32. So you need to explicitly cast to uint64 one of width or height too

uint64 npixels = (uint64)width * height;

It is also necessary to check the pointer returned by _TIFFmalloc() to assure that it is not NULL. Address space and memory is finite.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/