2023.06.07 19:02 "Re: [Tiff] 4.5.1 release soon", by Bob Friesenhahn
The suggested work-around caused the program to not work with older libtiff, and even the most recent release. I just put a fix into GraphicsMagick to solve that.
Can you point to the commit with your fix? That could potentially be interesting for others
My fixes are somewhat GraphicsMagick dependent, but the approach may still be useful for others
First "Automate the collection of TIFF attributes. Fixes "Stack-buffer-overflow in _TIFFVGetField.". This works based on information from TIFFFieldPassCount() as suggested by yourself (Even Rouault):
But then, after learning that older libtiff throws a "hard" error from TIFFFieldWithTag() if it does not yet know about the tag, I added some code to the error handler which matches the problematic error and ignores it:
Perhaps a third addition will be to provided "legacy" behavior for tags where TIFFFieldWithTag() returns NULL so that values are still read.
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt