Skip to content

Commit 870c4e7

Browse files
author
Jiang Jiang
committed
Fix crash in positionInLigature
Check boundary of pos before accessing attributes. Task-number: QTBUG-23104 Reviewed-by: Eskil
1 parent 5e07a3a commit 870c4e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/text/qtextengine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
28052805
closestItem--;
28062806
int pos = si->position + clusterStart + closestItem;
28072807
// Jump to the next charStop
2808-
while (!attrs[pos].charStop && pos < end)
2808+
while (pos < end && !attrs[pos].charStop)
28092809
pos++;
28102810
return pos;
28112811
}

0 commit comments

Comments
 (0)