summaryrefslogtreecommitdiffstats
path: root/src/PYPPhoneticEditor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r--src/PYPPhoneticEditor.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
index 6be7079..dc66689 100644
--- a/src/PYPPhoneticEditor.cc
+++ b/src/PYPPhoneticEditor.cc
@@ -314,6 +314,10 @@ LibPinyinPhoneticEditor::getPinyinCursor ()
gboolean
LibPinyinPhoneticEditor::selectCandidate (guint i)
{
+
+ if (G_UNLIKELY (i >= m_candidates->len))
+ return FALSE;
+
guint pinyin_cursor = getPinyinCursor ();
/* NOTE: deal with normal candidates selection here by libpinyin. */