Commit 8ae629b1 authored by Boudewijn Rempt's avatar Boudewijn Rempt

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

6. divide_by_zero: In function call computeCenter, division by expression
this->m_cornerCount which may be zero has undefined behavior. [hide
details]
parent 26fec5cb
......@@ -283,7 +283,11 @@ QPointF StarShape::computeCenter() const
center += points[2 * i]->point();
}
}
return center / static_cast<qreal>(m_cornerCount);
if (m_cornerCount > 0) {
return center / static_cast<qreal>(m_cornerCount);
}
return center;
}
bool StarShape::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context)
......
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