summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qrasterizer.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-07 16:45:41 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-10 08:16:23 +0000
commit036c13a0f48ea964da36c6ac01b379d9aa52fdc1 (patch)
treedfcfdf0fc0f570b18c242eeb3d64055a8ba7ba65 /src/gui/painting/qrasterizer.cpp
parentddc5af9f17474129223c7bbac58b57bb3ed0ff74 (diff)
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. Pick-to: 6.1 5.15 Change-Id: I5721c469441f15ac112180f971c857cd67edbf96 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qrasterizer.cpp')
-rw-r--r--src/gui/painting/qrasterizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index e851a3876a..7b26b20db8 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),