ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-5.01.tar.gz
[xscreensaver] / utils / erase.c
index feefd69d7d2db06355536ff9ced2fea7680e3d1c..4e7a9d40ca1184d50a60818d1722b9e2a1385e5c 100644 (file)
@@ -451,7 +451,7 @@ random_squares (eraser_state *st)
     {
       st->cols = 10 + random() % 30;
       size = st->width / st->cols;
-      rows = (st->height / size) + 1;
+      rows = (size ? (st->height / size) : 0) + 1;
       st->nlines = st->cols * rows;
       st->lines = (int *) calloc (st->nlines, sizeof(*st->lines));
 
@@ -469,7 +469,7 @@ random_squares (eraser_state *st)
     }
 
   size = st->width / st->cols;
-  rows = (st->height / size) + 1;
+  rows = (size ? (st->height / size) : 0) + 1;
 
   for (i = st->nlines * st->prev_ratio;
        i < st->nlines * st->ratio;