summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2021-06-08 16:49:53 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2021-06-17 09:58:27 +0000
commite473d96e65e7cf3190c6c16acace6359964d0bee (patch)
tree4b374ac6f9a2537af847c881c7f5e870ed988efb /src
parent68b855c215865a865672e2a43a70b2033e97a0f3 (diff)
Avoid overflow in text layout
Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Pick-to: 6.2 6.1 5.15 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextlayout.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 48f26f8665..1ce35c2ff2 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1937,7 +1937,8 @@ void QTextLine::layout_helper(int maxGlyphs)
if (lbh.currentPosition >= eng->layoutData->string.length()
|| isBreakableSpace
- || attributes[lbh.currentPosition].lineBreak) {
+ || attributes[lbh.currentPosition].lineBreak
+ || lbh.tmpData.textWidth >= QFIXED_MAX) {
sb_or_ws = true;
break;
} else if (attributes[lbh.currentPosition].graphemeBoundary) {