fixed bug with unterminated files, and strips per separation change

This commit is contained in:
Frank Warmerdam 2000-08-14 16:21:54 +00:00
parent e0433eb06e
commit c1282751c6
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2000-08-14 Frank Warmerdam <warmerda@rommel.atlsci.com>
* 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 <warmerda@cs46980-c> 2000-07-17 Frank Warmerdam <warmerda@cs46980-c>
* Tentatively added support for SAMPLEFORMAT_COMPLEXIEEEFP, and * Tentatively added support for SAMPLEFORMAT_COMPLEXIEEEFP, and

View File

@ -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 * 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 * rows in the strip (check for truncated last strip on any
* of the separations). * of the separations).
*/ */
strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1) if( td->td_rowsperstrip >= td->td_imagelength )
/ td->td_rowsperstrip; strips_per_sep = 1;
else
strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1)
/ td->td_rowsperstrip;
sep_strip = strip % strips_per_sep; sep_strip = strip % strips_per_sep;
if (sep_strip != strips_per_sep-1 || if (sep_strip != strips_per_sep-1 ||