From 3801808ade9f748de0ee367f3100e7b5f2f01f17 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 7 May 2021 16:45:41 +0200 Subject: [PATCH] Avoid coverage overflow We end up excluding more than 65536 from 65536 of rowHeight. Perhaps better fixed earlier, but I can't figure this logic out right now. Change-Id: I5721c469441f15ac112180f971c857cd67edbf96 Reviewed-by: Eirik Aavitsland (cherry picked from commit 036c13a0f48ea964da36c6ac01b379d9aa52fdc1) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qrasterizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index e851a3876a7..7b26b20db86 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -1096,6 +1096,8 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP); } + if (excluded > QScFixedFactor) + excluded = excluded % QScFixedFactor; QScFixed coverage = rowHeight - excluded; buffer.addSpan(x, 1, QScFixedToInt(yFP), @@ -1117,6 +1119,8 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, excluded += (rowBottom - rowTopRight) - intersectPixelFP(x, rowTopRight, rowBottom, bottomRightIntersectBf, topRightIntersectBf, bottomRightSlopeFP, invBottomRightSlopeFP); + if (excluded > QScFixedFactor) + excluded = excluded % QScFixedFactor; QScFixed coverage = rowHeight - excluded; buffer.addSpan(x, 1, QScFixedToInt(yFP),