summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-05 20:38:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-02-06 13:10:08 +0100
commit05b067f05c561b1993deeea84a5700805bc9c3a6 (patch)
tree016175ebfccfc7fd776ab3df5476313f5e62d7db /vcl/qt5
parent1d6140b7cc3412340626e5adac70d5c0a9fdbb39 (diff)
qt5: crash entering ë with french IM
which for me with french IM enabled on my keyboard is physically AltGr+[ (crashes here on trying to underline ¨ with a length of 2) then e. Change-Id: Id59bd84af2ab4d8403b11b1a13efb2bbdb608199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129538 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtWidget.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index d999ebbb7bd8..ca74b9d118f0 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -691,7 +691,15 @@ void QtWidget::inputMethodEvent(QInputMethodEvent* pEvent)
if (aCharFormat.fontStrikeOut())
aETIP |= ExtTextInputAttr::RedText;
for (int j = rAttr.start; j < rAttr.start + rAttr.length; j++)
+ {
+ SAL_WARN_IF(j >= static_cast<int>(aTextAttrs.size()), "vcl.qt",
+ "QInputMethodEvent::Attribute out of range. Broken range: "
+ << rAttr.start << "," << rAttr.start + rAttr.length
+ << " Legal range: 0," << aTextAttrs.size());
+ if (j >= static_cast<int>(aTextAttrs.size()))
+ break;
aTextAttrs[j] = aETIP;
+ }
}
break;
}