diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2020-02-24 21:41:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 21:41:42 +0300 |
commit | 63dc5b7b768267e402c1b12ac9694d7d62d9dae9 (patch) | |
tree | ad3701d9a9a469574429d410c3ebc8379b429614 | |
parent | d1c4ef5933358c013f2a7eee208114e34760c98c (diff) |
[Pango] Add nil check before CFArrayGetCount() (#154)2019-10
Co-authored-by: Cody Russell <cody@jhu.edu>
-rw-r--r-- | packages/pango.py | 5 | ||||
-rw-r--r-- | packages/patches/pango-ctfaces-nil-check.patch | 28 |
2 files changed, 32 insertions, 1 deletions
diff --git a/packages/pango.py b/packages/pango.py index 00ba8c2..54a625f 100644 --- a/packages/pango.py +++ b/packages/pango.py @@ -41,7 +41,10 @@ class PangoPackage (GnomeXzPackage): # https://devdiv.visualstudio.com/DevDiv/_workitems/edit/573960 'patches/pango-get-shaper-for-ideographic-space.patch', - 'patches/pango-familyName.patch' + 'patches/pango-familyName.patch', + + # https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1069059 + 'patches/pango-ctfaces-nil-check.patch' ]) def prep(self): diff --git a/packages/patches/pango-ctfaces-nil-check.patch b/packages/patches/pango-ctfaces-nil-check.patch new file mode 100644 index 0000000..6aaeca5 --- /dev/null +++ b/packages/patches/pango-ctfaces-nil-check.patch @@ -0,0 +1,28 @@ +diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c +old mode 100644 +new mode 100755 +index 27132c4..5de6209 +--- a/pango/pangocoretext-fontmap.c ++++ b/pango/pangocoretext-fontmap.c +@@ -573,8 +573,8 @@ pango_core_text_family_list_faces (PangoFontFamily *family, + CFArrayRef ctfaces; + CFArrayRef font_descriptors; + CFDictionaryRef attributes; +- CFIndex i, count; +- ++ CFIndex i; ++ CFIndex count = 0; + CFTypeRef keys[] = { + (CFTypeRef) kCTFontFamilyNameAttribute + }; +@@ -605,7 +605,9 @@ pango_core_text_family_list_faces (PangoFontFamily *family, + + italic_faces = g_hash_table_new (g_direct_hash, g_direct_equal); + +- count = CFArrayGetCount (ctfaces); ++ if (ctfaces) ++ count = CFArrayGetCount (ctfaces); ++ + for (i = 0; i < count; i++) + { + PangoCoreTextFace *face; |