summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-07-13 13:06:43 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-07-13 13:10:08 (GMT)
commitc0772f44fb1d53608ff629fc622103698c6d0ee5 (patch)
tree4a0bbbc06012cdff8cdd20cb655c1c07c15e0cdf
parent2118a8df91263dcadd1ca0067caed84d1c749977 (diff)
downloadQt-c0772f44fb1d53608ff629fc622103698c6d0ee5.zip
Qt-c0772f44fb1d53608ff629fc622103698c6d0ee5.tar.gz
Qt-c0772f44fb1d53608ff629fc622103698c6d0ee5.tar.bz2
Fix potential crash when clicking in a text edit
Since the attributes() call might resize the layout and therefore delete the previous data, the logClusters pointer might be dangling at this point. We need to reget it to make sure it's valid. Task-number: QTBUG-20310 Reviewed-by: Jiang Jiang
-rw-r--r--src/gui/text/qtextengine.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 648f5c0..6c13eae 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2789,6 +2789,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
}
const HB_CharAttributes *attrs = attributes();
+ logClusters = this->logClusters(si);
clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart);
if (clusterLength) {