diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-12-14 15:33:09 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-12-15 12:38:20 (GMT) |
commit | 6c10c6b1dead65c4fef0fb04295cd360a54f5186 (patch) | |
tree | 6c94f4dd52966f4e4c98470d354e0eac9ec6657b /src | |
parent | ac41c7da1e7da954e48ebdcefb1de53ce2911e75 (diff) | |
download | Qt-6c10c6b1dead65c4fef0fb04295cd360a54f5186.zip Qt-6c10c6b1dead65c4fef0fb04295cd360a54f5186.tar.gz Qt-6c10c6b1dead65c4fef0fb04295cd360a54f5186.tar.bz2 |
Fixed integer overflow in QTriangulator.
The result of a function returning qint64 was stored in an int.
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/gl2paintengineex/qtriangulator.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index 21d4b2e..6a1112b 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -1779,7 +1779,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); if (d == 0) { result.first = result.second = current; break; @@ -1793,7 +1793,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d >= 0); if (d == 0) { result.first = current; @@ -1807,7 +1807,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d <= 0); if (d == 0) { result.second = current; @@ -1828,7 +1828,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); if (d == 0) break; if (d < 0) { @@ -1849,7 +1849,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d >= 0); if (d == 0) { current = current->left; @@ -1863,7 +1863,7 @@ QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d <= 0); if (d == 0) { current = current->right; |