summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_linux.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/render_text_linux.cc')
-rw-r--r--ui/gfx/render_text_linux.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc
index e2f0d67..2777006 100644
--- a/ui/gfx/render_text_linux.cc
+++ b/ui/gfx/render_text_linux.cc
@@ -284,6 +284,8 @@ void RenderTextLinux::DrawVisualText(Canvas* canvas) {
}
size_t RenderTextLinux::IndexOfAdjacentGrapheme(size_t index, bool next) {
+ if (index > text().length())
+ return text().length();
EnsureLayout();
return Utf16IndexOfAdjacentGrapheme(Utf16IndexToUtf8Index(index), next);
}