From 78563b4ff9038601a72c42bf48061d1132fb24fe Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Fri, 21 Apr 2000 21:45:33 +0000 Subject: [PATCH] Don't use estimate strip byte count for one tile/strip images with an offset, and byte count of zero. These could be "unpopulated" images. --- libtiff/tif_dirread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index c1d6c420..7796ebb4 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.5 2000-01-28 21:00:20 warmerda Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirread.c,v 1.6 2000-04-21 21:45:33 warmerda Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -506,7 +506,7 @@ TIFFReadDirectory(TIFF* tif) _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); EstimateStripByteCounts(tif, dir, dircount); #define BYTECOUNTLOOKSBAD \ - (td->td_stripbytecount[0] == 0 || \ + ((td->td_stripbytecount[0] == 0 && td->td_stripoffset[0] != 0) || \ (td->td_compression == COMPRESSION_NONE && \ td->td_stripbytecount[0] > TIFFGetFileSize(tif) - td->td_stripoffset[0])) } else if (td->td_nstrips == 1 && BYTECOUNTLOOKSBAD) {