summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xfa/fwl/cfwl_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index b98278c622..0067cab20a 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -1098,7 +1098,7 @@ void CFWL_Edit::SetCursorPosition(size_t position) {
if (m_CursorPosition == position)
return;
- m_CursorPosition = position;
+ m_CursorPosition = std::min(position, m_EdtEngine.GetLength());
UpdateCursorRect();
OnCaretChanged();
}