about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-27 18:33:15 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-27 18:33:15 +0000
commit5714a63997a2a34bda5d2b6f682cdcc63fbcfc9f (patch)
treef11d76c7176d0ef0e5c07a3af6f895538fc6317c /generator
parent77fb425477358f9af21e38d2f5e55d9de1375a75 (diff)
downloadnetpbm-mirror-5714a63997a2a34bda5d2b6f682cdcc63fbcfc9f.tar.gz
netpbm-mirror-5714a63997a2a34bda5d2b6f682cdcc63fbcfc9f.tar.xz
netpbm-mirror-5714a63997a2a34bda5d2b6f682cdcc63fbcfc9f.zip
Release 10.47.45
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1960 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r--generator/ppmforge.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generator/ppmforge.c b/generator/ppmforge.c
index 80e35822..c77076e3 100644
--- a/generator/ppmforge.c
+++ b/generator/ppmforge.c
@@ -491,7 +491,7 @@ createPlanetStuff(float *          const a,
             double const bx = (n - 1) * uprj(j, cols);
             
             bxf[j] = floor(bx);
-            bxc[j] = bxf[j] + 1;
+            bxc[j] = MIN(bxf[j] + 1, n - 1);
             u[j] = bx - bxf[j];
             u1[j] = 1 - u[j];
         }
@@ -1051,6 +1051,9 @@ main(int argc, char ** argv) {
             if ((i == argc) || (sscanf(argv[i], "%d", &meshsize) != 1))
                 pm_usage(usage);
 
+            if (meshsize < 2)
+                pm_error("mesh must be at least 2");
+
             /* Force FFT mesh to the next larger power of 2. */
 
             for (j = meshsize; (j & 1) == 0; j >>= 1) ;