diff --git a/Lib/patterns4.c b/Lib/patterns4.c index 0c4a900..5afcc9a 100644 --- a/Lib/patterns4.c +++ b/Lib/patterns4.c @@ -23,6 +23,12 @@ int x, y, v, delta; delta = high - low; +if (0 == delta) { + fprintf(stderr, "%s: bad low/high parameters %d %d <- delta is 0\n", + __func__, low, high); + return DIVISOR_IS_ZERO; + } + for (x=0; xwidth; x++) { for (y=0; yheight; y++) @@ -44,6 +50,12 @@ int x, y, r, g, b, delta; delta = high - low; +if (0 == delta) { + fprintf(stderr, "%s: bad low/high parameters %d %d <- delta is 0\n", + __func__, low, high); + return DIVISOR_IS_ZERO; + } + for (x=0; xwidth; x++) { for (y=0; yheight; y++)