add a zerodivide mollyguard

This commit is contained in:
tTh 2023-09-18 15:29:40 +02:00
parent 226d1b39a9
commit 7b10854729

View File

@ -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; x<dst->width; x++)
{
for (y=0; y<dst->height; 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; x<dst->width; x++)
{
for (y=0; y<dst->height; y++)