You need to log in before you can comment on or make changes to this bug.
Created an attachment (id=395) [details] TIFFGetField->TIFFGetFieldDefaulted in a few places I found three places in tif_strip.c that assume that TIFFGetField(TIFFTAG_YCBCRSUBSAMPLING) will always succeed. This is not correct; what they actually want is TIFFGetFieldDefaulted, which can be assumed to succeed since there's a place to get the defaults if no such tag was provided by the input file. I attach a patch that fixes the immediate problem in 3.9.2, but I would suggest a generic review of the code to see if anyplace else needs a similar change. Or maybe a more radical bit of future-proofing is called for --- should TIFFGetFieldDefaulted even be a separate function, or should TIFFGetField just always return defaults if some exist?
I've committed your patch to the CVS 3.9 branch. I have not performed a full code audit as suggested, however. These changes appear to already have been made in CVS HEAD, so they don't apply there. Thanks.