summaryrefslogtreecommitdiff
path: root/libtiff/tif_dirread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtiff/tif_dirread.c')
-rw-r--r--libtiff/tif_dirread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index ef21f7f5..d4cc11d0 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -4067,8 +4067,11 @@ int TIFFReadDirectory(TIFF *tif)
if (tif->tif_nextdiroff == 0)
{
- /* In this special case, tif_diroff needs also to be set to 0. */
+ /* In this special case, tif_diroff needs also to be set to 0.
+ * Furthermore, TIFFSetDirectory() needs to be switched to
+ * absolute stepping. */
tif->tif_diroff = tif->tif_nextdiroff;
+ tif->tif_setdirectory_force_absolute = TRUE;
return 0; /* last offset, thus no checking necessary */
}
@@ -5131,6 +5134,8 @@ int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff,
} /*-- if (!dp->tdir_ignore) */
}
}
+ /* To be able to return from SubIFD or custom-IFD to main-IFD */
+ tif->tif_setdirectory_force_absolute = TRUE;
if (dir)
_TIFFfreeExt(tif, dir);
return 1;