From 1bd824a28960a531692d09ac53dcebaff887e228 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Mon, 30 Jun 2003 08:24:40 +0000 Subject: [PATCH] Fixed problem with EstimateStripByteCounts() as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=358 --- libtiff/tif_dirread.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 3478aeb8..7d846410 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirread.c,v 1.17 2003-06-19 21:36:03 warmerda Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirread.c,v 1.18 2003-06-30 08:24:40 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -263,7 +263,6 @@ TIFFReadDirectory(TIFF* tif) while (fix < tif->tif_nfields && tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) fix++; - /* dp->tdir_tag = IGNORE; */ } /* * Null out old tags that we ignore. @@ -613,14 +612,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) /* calculate amount of space used by indirect values */ for (dp = dir, n = dircount; n > 0; n--, dp++) { - uint32 cc; - if(dp->tdir_tag == IGNORE) - { - TIFFError(tif->tif_name, - "Cannot determine StripByteCounts values, because of tags with unknown sizes"); - return -1; - } - cc = dp->tdir_count*TIFFDataWidth(dp->tdir_type); + uint32 cc = dp->tdir_count*TIFFDataWidth(dp->tdir_type); if (cc > sizeof (uint32)) space += cc; } @@ -656,8 +648,11 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) static void MissingRequired(TIFF* tif, const char* tagname) { - TIFFError(tif->tif_name, - "TIFF directory is missing required \"%s\" field", tagname); + static const char module[] = "MissingRequired"; + + TIFFError(module, + "%.1000s: TIFF directory is missing required \"%s\" field", + tif->tif_name, tagname); } /*