From 08f2d19fab97e8f87c61986aa4e1399403645737 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Thu, 20 Sep 2007 19:20:54 +0000 Subject: [PATCH] more improvements to error reporting in TIFFFetchDirectory --- libtiff/tif_dirread.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 3303c8b0..b25c6ea0 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.131 2007-09-20 16:34:23 fwarmerdam Exp $ */ +/* $Id: tif_dirread.c,v 1.132 2007-09-20 19:20:54 fwarmerdam Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -3339,16 +3339,18 @@ TIFFReadDirectory(TIFF* tif) uint16 di; const TIFFField* fip; uint32 fii; + toff_t nextdiroff; tif->tif_diroff=tif->tif_nextdiroff; if (!TIFFCheckDirOffset(tif,tif->tif_nextdiroff)) return 0; /* last offset or bad offset (IFD looping) */ (*tif->tif_cleanup)(tif); /* cleanup any previous compression state */ tif->tif_curdir++; - dircount=TIFFFetchDirectory(tif,tif->tif_nextdiroff,&dir,&tif->tif_nextdiroff); + nextdiroff = tif->tif_nextdiroff; + dircount=TIFFFetchDirectory(tif,nextdiroff,&dir,&tif->tif_nextdiroff); if (!dircount) { TIFFErrorExt(tif->tif_clientdata,module, - "Failed to read directory at offset %llu",tif->tif_nextdiroff); + "Failed to read directory at offset %llu",nextdiroff); return 0; } TIFFReadDirectoryCheckOrder(tif,dir,dircount);