Commit b34f3577 authored by Jason Crain's avatar Jason Crain Committed by Carlos Garcia Campos
Browse files

a11y: Fix crash with Orca screen reader

ev_page_accessible_get_substring gets called with out of bounds values
leading to a crash.  Clamp start_offset to a valid range.

https://bugzilla.gnome.org/show_bug.cgi?id=777992
parent a87ad745
......@@ -487,9 +487,9 @@ ev_page_accessible_get_substring (AtkText *text,
return NULL;
page_text = ev_page_cache_get_text (view->page_cache, self->priv->page);
start_offset = MAX (0, start_offset);
if (end_offset < 0 || end_offset > g_utf8_strlen (page_text, -1))
end_offset = strlen (page_text);
start_offset = CLAMP (start_offset, 0, end_offset);
substring = g_utf8_substring (page_text, start_offset, end_offset);
normalized = g_utf8_normalize (substring, -1, G_NORMALIZE_NFKC);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment