From 1e0395f73e624bf9d40f508acd3da08294006947 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 7 Feb 2019 12:18:07 +0100 Subject: 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 --- src/gui/painting/qrasterizer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/gui/painting/qrasterizer.cpp') 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; -- cgit v1.2.3