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>
bb10
Eirik Aavitsland 2019-02-07 12:18:07 +01:00
parent a2b31cd5db
commit 1e0395f73e
1 changed files with 1 additions and 3 deletions

View File

@ -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;