From 0aa0a6dbced7169658301220953eec610f276dc1 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Tue, 9 Apr 2002 20:48:53 +0000 Subject: [PATCH] Divide by zero fixed. Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=88 --- tools/tiff2ps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c index 58c58c56..f0b6cceb 100644 --- a/tools/tiff2ps.c +++ b/tools/tiff2ps.c @@ -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 @@ -367,9 +367,9 @@ setupPageState(TIFF* tif, uint32* pw, uint32* ph, float* pprw, float* pprh) /* * Calculate printable area. */ - if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres)) + if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) || !xres) xres = PS_UNIT_SIZE; - if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres)) + if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) || !yres) yres = PS_UNIT_SIZE; switch (res_unit) { case RESUNIT_CENTIMETER: