Skip to content

Fix TIFFUnlinkDirectory(0) case and unlink of first directory.

Su Laus requested to merge Su_Laus/libtiff:fix_Unlink_first_directory_0 into master

Fix TIFFUnlinkDirectory(0) case and unlink of first directory.

If directory number 0 is unlinked, then the base offset variables within LibTiff are not updated. As a result, a subsequent TIFFSetDirectory() first goes to the unlinked former directory number 0.

In addition, the error case for dirn=0 is handled.

This MR fixes that by updating the base offset variables tif->tif_header.classic.tiff_diroff and tif->tif_header.big.tiff_diroff, respectively.

Merge request reports