From 8c5ba4084a05b489e9de867ab620716438562ec5 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 27 Mar 2021 19:07:23 +0000 Subject: Fail if -dimension is greater than 5 git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4073 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- generator/ppmforge.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'generator') diff --git a/generator/ppmforge.c b/generator/ppmforge.c index c7cfdb84..7cef571f 100644 --- a/generator/ppmforge.c +++ b/generator/ppmforge.c @@ -34,6 +34,7 @@ #define _XOPEN_SOURCE 500 /* get M_PI in math.h */ #include +#include #include #include "pm_c_util.h" @@ -169,6 +170,11 @@ parseCommandLine(int argc, const char **argv, if (cmdlineP->dimension <= 0.0) pm_error("-dimension must be greater than zero. " "You specified %f", cmdlineP->dimension); + else if (cmdlineP->dimension > 5.0 + FLT_EPSILON) + pm_error("-dimension must not be greater than 5. " + "Results are not interesting with higher numbers, so " + "we assume it is a mistake. " + "You specified %f", cmdlineP->dimension); } else cmdlineP->dimension = cmdlineP->clouds ? 2.15 : 2.4; -- cgit 1.4.1