Never return 0 from the TIFFNumberOfStrips().

This commit is contained in:
Andrey Kiselev 2004-04-30 08:34:44 +00:00
parent 29e9522c6f
commit 51cc3940e8

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_strip.c,v 1.3 2003-11-07 11:26:38 dron Exp $ */
/* $Id: tif_strip.c,v 1.4 2004-04-30 08:34:44 dron Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -62,8 +62,7 @@ TIFFNumberOfStrips(TIFF* tif)
TIFFDirectory *td = &tif->tif_dir;
tstrip_t nstrips;
nstrips = (td->td_rowsperstrip == (uint32) -1 ?
(td->td_imagelength != 0 ? 1 : 0) :
nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
TIFFhowmany(td->td_imagelength, td->td_rowsperstrip));
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
nstrips *= td->td_samplesperpixel;