[pango/f19] Backport a patch to fix SIGFPE in pango_layout_iter_get_char_extents() (#1036351)

Akira TAGOH tagoh at fedoraproject.org
Thu Jan 23 01:54:18 UTC 2014


commit 7cd35e7793015d823d4c6ef5c32a207af4c9d514
Author: Akira TAGOH <tagoh at redhat.com>
Date:   Thu Jan 23 10:54:36 2014 +0900

    Backport a patch to fix SIGFPE in pango_layout_iter_get_char_extents() (#1036351)

 pango-fix-sigfpe.patch |   35 +++++++++++++++++++++++++++++++++++
 pango.spec             |    7 ++++++-
 2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/pango-fix-sigfpe.patch b/pango-fix-sigfpe.patch
new file mode 100644
index 0000000..2028e62
--- /dev/null
+++ b/pango-fix-sigfpe.patch
@@ -0,0 +1,35 @@
+From a6c318ee505aeabe6f84e1543d68834b9e0e7acf Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <behdad at behdad.org>
+Date: Sun, 15 Dec 2013 18:42:17 -0500
+Subject: [PATCH] Bug 720379 - SIGFPE in pango_layout_iter_get_char_extents()
+
+Untested.
+---
+ pango/pango-layout.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/pango/pango-layout.c b/pango/pango-layout.c
+index a024d11..607a5f0 100644
+--- a/pango/pango-layout.c
++++ b/pango/pango-layout.c
+@@ -6178,8 +6178,15 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
+       return;
+     }
+ 
+-  x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
+-  x1 = ((iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
++  if (iter->cluster_num_chars)
++  {
++    x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
++    x1 = ((iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
++  }
++  else
++  {
++    x0 = x1 = 0;
++  }
+ 
+   logical_rect->width = x1 - x0;
+   logical_rect->height = cluster_rect.height;
+-- 
+1.8.4.2
+
diff --git a/pango.spec b/pango.spec
index f23450b..877fc6b 100644
--- a/pango.spec
+++ b/pango.spec
@@ -10,7 +10,7 @@
 Summary: System for layout and rendering of internationalized text
 Name: pango
 Version: 1.34.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 #VCS: git:git://git.gnome.org/pango
@@ -35,6 +35,8 @@ BuildRequires: cairo-gobject-devel
 # Bootstrap requirements
 BuildRequires: gnome-common intltool gtk-doc
 
+Patch0: %{name}-fix-sigfpe.patch
+
 %description
 Pango is a library for laying out and rendering of text, with an emphasis
 on internationalization. Pango can be used anywhere that text layout is needed,
@@ -136,6 +138,9 @@ fi
 
 
 %changelog
+* Thu Jan 23 2014 Akira TAGOH <tagoh at redhat.com> - 1.34.1-2
+- Backport a patch to fix SIGFPE in pango_layout_iter_get_char_extents() (#1036351)
+
 * Mon May 13 2013 Richard Hughes <rhughes at redhat.com> - 1.34.1-1
 - Update to 1.34.1
 


More information about the fonts-bugs mailing list