[atril] 01/01: debian/patches: Add 0002_a11y_fixes.patch. Fix crash while using Orca screen reader.

Martin Wimpress flexiondotorg-guest at moszumanska.debian.org
Tue Apr 10 21:45:57 UTC 2018


This is an automated email from the git hooks/post-receive script.

flexiondotorg-guest pushed a commit to branch master
in repository atril.

commit 8d4c8a4e48e90a5dc7e921c0179bfb91f71e9ed1
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date:   Tue Apr 10 22:26:57 2018 +0100

    debian/patches: Add 0002_a11y_fixes.patch. Fix crash while using Orca screen reader.
---
 debian/patches/0002_a11y_fixes.patch | 60 ++++++++++++++++++++++++++++++++++++
 debian/patches/series                |  1 +
 2 files changed, 61 insertions(+)

diff --git a/debian/patches/0002_a11y_fixes.patch b/debian/patches/0002_a11y_fixes.patch
new file mode 100644
index 0000000..5f24b89
--- /dev/null
+++ b/debian/patches/0002_a11y_fixes.patch
@@ -0,0 +1,60 @@
+Author: Jason Crain <jason at inspiresomeone.us>
+Description: Fix crash while using Orca screen reader
+
+diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
+index 7e97b95..8d07a31 100644
+--- a/libview/ev-page-accessible.c
++++ b/libview/ev-page-accessible.c
+@@ -489,9 +489,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);
+@@ -543,23 +543,26 @@ ev_page_accessible_get_range_for_boundary (AtkText          *text,
+ 	if (!log_attrs)
+ 		return;
+ 
++	if (offset < 0 || offset >= n_attrs)
++		return;
++
+ 	switch (boundary_type) {
+ 	case ATK_TEXT_BOUNDARY_CHAR:
+ 		start = offset;
+ 		end = offset + 1;
+ 		break;
+ 	case ATK_TEXT_BOUNDARY_WORD_START:
+-		for (start = offset; start >= 0 && !log_attrs[start].is_word_start; start--);
+-		for (end = offset + 1; end <= n_attrs && !log_attrs[end].is_word_start; end++);
++		for (start = offset; start > 0 && !log_attrs[start].is_word_start; start--);
++		for (end = offset + 1; end < n_attrs && !log_attrs[end].is_word_start; end++);
+ 		break;
+ 	case ATK_TEXT_BOUNDARY_SENTENCE_START:
+-		for (start = offset; start >= 0; start--) {
++		for (start = offset; start > 0; start--) {
+ 			if (log_attrs[start].is_mandatory_break && treat_as_soft_return (view, self->priv->page, log_attrs, start - 1))
+ 				continue;
+ 			if (log_attrs[start].is_sentence_start)
+ 				break;
+ 		}
+-		for (end = offset + 1; end <= n_attrs; end++) {
++		for (end = offset + 1; end < n_attrs; end++) {
+ 			if (log_attrs[end].is_mandatory_break && treat_as_soft_return (view, self->priv->page, log_attrs, end - 1))
+ 				continue;
+ 			if (log_attrs[end].is_sentence_start)
+@@ -567,8 +570,8 @@ ev_page_accessible_get_range_for_boundary (AtkText          *text,
+ 		}
+ 		break;
+ 	case ATK_TEXT_BOUNDARY_LINE_START:
+-		for (start = offset; start >= 0 && !log_attrs[start].is_mandatory_break; start--);
+-		for (end = offset + 1; end <= n_attrs && !log_attrs[end].is_mandatory_break; end++);
++		for (start = offset; start > 0 && !log_attrs[start].is_mandatory_break; start--);
++		for (end = offset + 1; end < n_attrs && !log_attrs[end].is_mandatory_break; end++);
+ 		break;
+ 	default:
+ 		/* The "END" boundary types are deprecated */
diff --git a/debian/patches/series b/debian/patches/series
index c2b0131..8a3ef7f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001_fix_text_in_annotation_window.patch
+0002_a11y_fixes.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/atril.git



More information about the pkg-mate-commits mailing list