Adjust previous fix to avoid undue warning in some situations triggered by GDAL

This commit is contained in:
Even Rouault 2020-01-23 20:40:53 +01:00
parent 3db0ff91bc
commit f5e1d765eb
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -3909,10 +3909,17 @@ TIFFReadDirectory(TIFF* tif)
case TIFF_LONG8:
break;
default:
/* Warn except if directory typically created with TIFFDeferStrileArrayWriting() */
if( !(tif->tif_mode == O_RDWR &&
dp->tdir_count == 0 &&
dp->tdir_type == 0 &&
dp->tdir_offset.toff_long8 == 0) )
{
fip = TIFFFieldWithTag(tif,dp->tdir_tag);
TIFFWarningExt(tif->tif_clientdata,module,
"Invalid data type for tag %s",
fip ? fip->field_name : "unknown tagname");
}
break;
}
_TIFFmemcpy( &(tif->tif_dir.td_stripoffset_entry),
@ -3927,10 +3934,17 @@ TIFFReadDirectory(TIFF* tif)
case TIFF_LONG8:
break;
default:
/* Warn except if directory typically created with TIFFDeferStrileArrayWriting() */
if( !(tif->tif_mode == O_RDWR &&
dp->tdir_count == 0 &&
dp->tdir_type == 0 &&
dp->tdir_offset.toff_long8 == 0) )
{
fip = TIFFFieldWithTag(tif,dp->tdir_tag);
TIFFWarningExt(tif->tif_clientdata,module,
"Invalid data type for tag %s",
fip ? fip->field_name : "unknown tagname");
}
break;
}
_TIFFmemcpy( &(tif->tif_dir.td_stripbytecount_entry),