Commit d47d7885 authored by Boudewijn Rempt's avatar Boudewijn Rempt

CID 34788: Division or modulo by float zero (DIVIDE_BY_ZERO)

96. divide_by_zero: In expression 255. / sum, division by expression
sum which may be zero has undefined behavior.
parent 08b7ae33
......@@ -216,7 +216,7 @@ public:
SANITY_ZEROS();
if (sum != 255) {
if (sum != 255 && sum > 0) {
qreal fixFactor = 255.0 / sum;
sum = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment