http://slackware.bholcomb.com/slackware/slackware-11.0/source/xap/xscreensaver/xscree...
[xscreensaver] / utils / colors.c
index c961539421dd340e3b36a2e1fc0b7ed38290f9a7..2e10b55b428f478b425d3fa749ca82edc926a01e 100644 (file)
@@ -480,6 +480,7 @@ make_smooth_colormap (Display *dpy, Visual *visual, Colormap cmap,
   double total_s = 0;
   double total_v = 0;
   Screen *screen = (dpy ? DefaultScreenOfDisplay(dpy) : 0); /* #### WRONG! */
+  int loop = 0;
 
   if (*ncolorsP <= 0) return;
 
@@ -495,6 +496,7 @@ make_smooth_colormap (Display *dpy, Visual *visual, Colormap cmap,
   for (i = 0; i < npoints; i++)
     {
     REPICK_THIS_COLOR:
+      if (++loop > 10000) abort();
       h[i] = random() % 360;
       s[i] = frand(1.0);
       v[i] = frand(0.8) + 0.2;