summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qstroker.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-04-04 10:53:06 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-04-25 06:06:45 +0000
commit8f8267f00bfa0d1716e38358ecc0fafff1d9df14 (patch)
tree4723cf0ea74afa27e4d901406ab8847549da19a2 /src/gui/painting/qstroker.cpp
parentf2b5baf9d0b723b721d9cb7c60a3c04afe904d4f (diff)
Avoid hanging on painting dashed lines with non-finite coordinates
The dash stroker did not check for inf/nan coordinates. Fixes: QTBUG-47887 Change-Id: I1e696cd15cc37d8fcb6a464cac3da33c3a8b95c2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/painting/qstroker.cpp')
-rw-r--r--src/gui/painting/qstroker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 292952b7c0..56d0917c6c 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -1150,6 +1150,8 @@ void QDashStroker::processCurrentSubpath()
QSubpathFlatIterator it(&m_elements, m_dashThreshold);
qfixed2d prev = it.next();
+ if (!prev.isFinite())
+ return;
bool clipping = !m_clip_rect.isEmpty();
qfixed2d move_to_pos = prev;
@@ -1165,6 +1167,8 @@ void QDashStroker::processCurrentSubpath()
bool hasMoveTo = false;
while (it.hasNext()) {
QStrokerOps::Element e = it.next();
+ if (!qfixed2d(e).isFinite())
+ continue;
Q_ASSERT(e.isLineTo());
cline = QLineF(qt_fixed_to_real(prev.x),