Divide by zero fixed. Closes

http://bugzilla.remotesensing.org/show_bug.cgi?id=88
This commit is contained in:
Andrey Kiselev 2002-04-09 20:48:53 +00:00
parent c47f69530c
commit 0aa0a6dbce

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiff2ps.c,v 1.4 2001-09-08 17:28:08 warmerda Exp $ */ /* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiff2ps.c,v 1.5 2002-04-09 20:48:53 dron Exp $ */
/* /*
* Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1988-1997 Sam Leffler
@ -367,9 +367,9 @@ setupPageState(TIFF* tif, uint32* pw, uint32* ph, float* pprw, float* pprh)
/* /*
* Calculate printable area. * Calculate printable area.
*/ */
if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres)) if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) || !xres)
xres = PS_UNIT_SIZE; xres = PS_UNIT_SIZE;
if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres)) if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) || !yres)
yres = PS_UNIT_SIZE; yres = PS_UNIT_SIZE;
switch (res_unit) { switch (res_unit) {
case RESUNIT_CENTIMETER: case RESUNIT_CENTIMETER: