summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2021-06-08 16:49:53 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-21 11:14:06 +0000
commitcbb3572fa65a8bd0310cf1be9940057c9aafbf7e (patch)
treebd585561d261410f2405edba327d5c1a0d463bc9 /src
parent7be133d0f5b85ad87313bdb48e50aa1fdc76efd1 (diff)
Avoid overflow in text layout
Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit e473d96e65e7cf3190c6c16acace6359964d0bee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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) {