http://www.jwz.org/xscreensaver/xscreensaver-5.11.tar.gz
[xscreensaver] / hacks / substrate.c
index 2ca25a99e456ba246ea3041dc5dacced000bd7dd..82c2bacd483b58c68703919e4aa047624a7b138b 100644 (file)
@@ -198,6 +198,13 @@ static inline void start_crack(struct field *f, crack *cr)
         /* We timed out.  Use our default values */
         px = cr->x;
         py = cr->y;
+
+        /* Sanity check needed */
+        if (px < 0) px = 0;
+        if (px >= f->width) px = f->width - 1;
+        if (py < 0) py = 0;
+        if (py >= f->height) py = f->height - 1;
+
         ref_cgrid(f, px, py) = cr->t;
     }
 
@@ -710,6 +717,7 @@ substrate_free (Display *dpy, Window window, void *closure)
 static const char *substrate_defaults[] = {
     ".background: white",
     ".foreground: black",
+    "*fpsSolid:        true",
     "*wireFrame: false",
     "*maxCycles: 10000",
     "*growthDelay: 18000",