diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-02-07 12:18:07 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-02-25 08:26:21 +0000 |
commit | 1e0395f73e624bf9d40f508acd3da08294006947 (patch) | |
tree | 9483f1f7dc84042c215a970e22a89f042dfb4977 | |
parent | a2b31cd5db6410144a613142a7b60f0cd2ba2b1d (diff) |
Fix assert when drawing lines with extreme coordinates
For extreme coordinates, the rasterizer's width parameter could become
NaN, which compares false with everything and hence would trigger an
assert.
Fixes: QTBUG-56434
Change-Id: I27abae6ab0bc94ce042be86ea0587095cdb7d487
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/gui/painting/qrasterizer.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 52501880e4..b4014272f4 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -755,11 +755,9 @@ static inline int qSafeFloatToQ16Dot16(qreal x) void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { - if (a == b || width == 0 || d->clipRect.isEmpty()) + if (a == b || !(width > 0.0) || d->clipRect.isEmpty()) return; - Q_ASSERT(width > 0.0); - QPointF pa = a; QPointF pb = b; |