[arch-commits] Commit in freetype2/trunk (PKGBUILD fix_segfault_with_harfbuzz.diff)

Andreas Radke andyrtr at nymeria.archlinux.org
Mon Mar 17 17:30:09 UTC 2014


    Date: Monday, March 17, 2014 @ 18:30:09
  Author: andyrtr
Revision: 208084

upgpkg: freetype2 2.5.3-2

fix segfault with harfbuzz; FS#39365

Added:
  freetype2/trunk/fix_segfault_with_harfbuzz.diff
Modified:
  freetype2/trunk/PKGBUILD

---------------------------------+
 PKGBUILD                        |   14 ++++++++++----
 fix_segfault_with_harfbuzz.diff |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-03-17 16:24:17 UTC (rev 208083)
+++ PKGBUILD	2014-03-17 17:30:09 UTC (rev 208084)
@@ -3,7 +3,7 @@
 
 pkgname=freetype2
 pkgver=2.5.3
-pkgrel=1
+pkgrel=2
 pkgdesc="TrueType font rendering library"
 arch=(i686 x86_64)
 license=('GPL')
@@ -14,18 +14,24 @@
 source=(http://downloads.sourceforge.net/sourceforge/freetype/freetype-${pkgver}.tar.bz2{,.sig}
         freetype-2.2.1-enable-valid.patch
         freetype-2.5.1-enable-spr.patch
-        freetype-2.5.1-enable-sph.patch)
+        freetype-2.5.1-enable-sph.patch
+        fix_segfault_with_harfbuzz.diff)
 sha1sums=('d3c26cc17ec7fe6c36f4efc02ef92ab6aa3f4b46'
           'SKIP'
           'f279d922a873d62a8af50bfc873051839d194dca'
           '13ee8d558593db991ad29fa090b461f914536104'
-          'c31fa3d342ead56f3acfa1f267b474a7686d0014')
+          'c31fa3d342ead56f3acfa1f267b474a7686d0014'
+          'c99013b4c19494cd26031878368191cd2b4459b0')
 
 prepare() {
   cd "${srcdir}/freetype-${pkgver}"
   patch -Np1 -i "${srcdir}/freetype-2.2.1-enable-valid.patch"
   patch -Np1 -i "${srcdir}/freetype-2.5.1-enable-spr.patch"
-
+  
+  # fix segfaults # https://bugs.archlinux.org/task/39365
+  # http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=23367ff97f33ef6a2b7e1fced1157c87a46d9596
+  patch -Np1 -i "${srcdir}/fix_segfault_with_harfbuzz.diff"
+  
   # Disabled for now due to resistance
   # Kept here for easier rebuilds via ABS
   # https://bugs.archlinux.org/task/35274

Added: fix_segfault_with_harfbuzz.diff
===================================================================
--- fix_segfault_with_harfbuzz.diff	                        (rev 0)
+++ fix_segfault_with_harfbuzz.diff	2014-03-17 17:30:09 UTC (rev 208084)
@@ -0,0 +1,32 @@
+From 23367ff97f33ef6a2b7e1fced1157c87a46d9596 Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl at gnu.org>
+Date: Mon, 17 Mar 2014 06:33:14 +0000
+Subject: Fix Savannah bug #41869.
+
+This works around a problem with HarfBuzz (<= 0.9.26), which doesn't
+validate glyph indices returned by
+`hb_ot_layout_lookup_collect_glyphs'.
+
+* src/autofit/hbshim.c (af_get_coverage): Guard `idx'.
+
+* docs/CHANGES: Updated.
+---
+diff --git a/src/autofit/hbshim.c b/src/autofit/hbshim.c
+index 11fb743..2eda8d7 100644
+--- a/src/autofit/hbshim.c
++++ b/src/autofit/hbshim.c
+@@ -347,6 +347,11 @@
+       count++;
+ #endif
+ 
++      /* HarfBuzz 0.9.26 and older doesn't validate glyph indices */
++      /* returned by `hb_ot_layout_lookup_collect_glyphs'...      */
++      if ( idx >= (hb_codepoint_t)globals->glyph_count )
++        continue;
++
+       if ( gstyles[idx] == AF_STYLE_UNASSIGNED )
+         gstyles[idx] = (FT_Byte)style_class->style;
+ #ifdef FT_DEBUG_LEVEL_TRACE
+--
+cgit v0.9.0.2
+




More information about the arch-commits mailing list