Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.3, 4.7.0, 4.7.1
-
None
-
d13e3441a9a3f11c7f9c9ebb21a514526987f56e
Description
I came across a problem in QTriangulatingStroker while debugging a program I'm working on.
I'm using QGraphicsView with OpenGL and quite large coordinates (ok, my fault...).
Large, and very close coordinates (e.g. y1 = -6022459.06174 and y2 = -6022459.17404, x1=x2) are casted from qreal(double) to float in QTriangulatingStroker::moveTo() and then passed to QTriangulatingStroker::normalVector(). After being converted to float both values equal -6022459.0 and normalVector tries to divide by the difference of them thus divides by zero.
The resulting invalid normal vector (-1.#IND000) is then passed to QTriangulatingStroker::arcPoints() in "case Qt::RoundCap" leading to "QVarLengthArray<float> points" of size 0.
The following while loop is never entered and in if( invisibleJump ) "..." m_vertices.at( count + 1 ) leads to an Q_ASSERT error because count is still m_vertices.size().
Summary: floating point precision problem --> uncaught devision by zero --> array bounds exception.