Access Violation when TIFF tag value cannot be allocated
Posted: 2014-06-20T13:00:12-07:00
When TIFF tags are being read and the memory allocation for a tag's data fails, the tag's pointer is correctly set to 0 and the error is noted at that time. However, later in TIFFGetProfiles(), when such a tag is encountered, the 0 pointer is dereferenced, causing an access violation. Adding to each conditional in TIFFGetProfiles() avoids this access violation.
Code: Select all
&& profile != (unsigned char*)NULL
Code: Select all
if (TIFFGetField(tiff,TIFFTAG_...,&length,&profile) == 1