TIFFWriteCheck(): call TIFFForceStrileArrayWriting() when needed (should have gone with eaeca6274a) (master only)

This commit is contained in:
Even Rouault 2019-07-09 13:56:18 +02:00
parent 6662e2b388
commit a21714f028
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -626,6 +626,20 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
if (tif->tif_scanlinesize == 0) if (tif->tif_scanlinesize == 0)
return (0); return (0);
tif->tif_flags |= TIFF_BEENWRITING; tif->tif_flags |= TIFF_BEENWRITING;
if( tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0 &&
!(tif->tif_flags & TIFF_DIRTYDIRECT) )
{
TIFFForceStrileArrayWriting(tif);
}
return (1); return (1);
} }