diff --git a/ChangeLog b/ChangeLog index 1b7bf6e1..3d53f258 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-08-14 Frank Warmerdam + + * tif_read.c: fixed up bug with files missing rowsperstrip and + the strips per separation fix done a few weeks ago. + 2000-07-17 Frank Warmerdam * Tentatively added support for SAMPLEFORMAT_COMPLEXIEEEFP, and diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c index 2771c70f..cac12cdf 100644 --- a/libtiff/tif_read.c +++ b/libtiff/tif_read.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_read.c,v 1.5 2000-07-12 19:20:52 warmerda Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_read.c,v 1.6 2000-08-14 16:21:54 warmerda Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -136,8 +136,12 @@ TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) * rows in the strip (check for truncated last strip on any * of the separations). */ - strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1) - / td->td_rowsperstrip; + if( td->td_rowsperstrip >= td->td_imagelength ) + strips_per_sep = 1; + else + strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1) + / td->td_rowsperstrip; + sep_strip = strip % strips_per_sep; if (sep_strip != strips_per_sep-1 ||