diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-04-01 01:56:45 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2011-04-01 01:56:45 +0000 |
commit | bd344dc79dbe8f67e97acb6e3fe0b1e94e3bb24e (patch) | |
tree | b61ee5fc2c7a9113fb0d71966ffce6897462b0ff | |
parent | be242df7305436f0cf192b70fa7c21c34e8cffba (diff) | |
download | netpbm-mirror-bd344dc79dbe8f67e97acb6e3fe0b1e94e3bb24e.tar.gz netpbm-mirror-bd344dc79dbe8f67e97acb6e3fe0b1e94e3bb24e.tar.xz netpbm-mirror-bd344dc79dbe8f67e97acb6e3fe0b1e94e3bb24e.zip |
Fix use of unset variable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1458 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/pnmtops.c | 14 | ||||
-rw-r--r-- | doc/HISTORY | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c index 2d513853..bcca8bfb 100644 --- a/converter/other/pnmtops.c +++ b/converter/other/pnmtops.c @@ -149,11 +149,13 @@ validateCompDimension(unsigned int const value, the actual computations don't have to be complicated with arithmetic overflow checks, so they're easier to read. -----------------------------------------------------------------------------*/ - unsigned int const maxWidthHeight = INT_MAX - 2; - unsigned int const maxScaleFactor = maxWidthHeight / value; + if (value > 0) { + unsigned int const maxWidthHeight = INT_MAX - 2; + unsigned int const maxScaleFactor = maxWidthHeight / value; - if (scaleFactor > maxScaleFactor) - pm_error("%s is too large for compuations: %u", vname, value); + if (scaleFactor > maxScaleFactor) + pm_error("%s is too large for compuations: %u", vname, value); + } } @@ -225,10 +227,10 @@ parseCommandLine(int argc, const char ** argv, cmdlineP->scale = 1.0; if (!widthSpec) - cmdlineP->width = 8.5; + width = 8.5; if (!heightSpec) - cmdlineP->height = 11.0; + height = 11.0; if (dpiSpec) parseDpi(dpiOpt, &cmdlineP->dpiX, &cmdlineP->dpiY); diff --git a/doc/HISTORY b/doc/HISTORY index 042a5bac..cf65ec8c 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -11,7 +11,10 @@ not yet BJH Release 10.55.00 supply a Standard Output accepter. Broken in 10.40.00. ppmtopbm: fix bug: crash ("internal error") on image without - palette (e.g. black and white). Broken in 10.54. + palette (e.g. black and white). Introduced in 10.54. + + pnmtops: fix floating point exception or bogus width/height + too large error. Introduced in 10.53. 11.03.30 BJH Release 10.54.00 |