diff --git a/racket/src/native-libs/build.rkt b/racket/src/native-libs/build.rkt index 7a71fd8c7f..f955c40eae 100644 --- a/racket/src/native-libs/build.rkt +++ b/racket/src/native-libs/build.rkt @@ -128,6 +128,9 @@ ;; Support registration of extra font families: (define-runtime-path coretext-fontreg-patch "patches/coretext-fontreg.patch") +;; Avoid crash when CTFontCollectionCreateMatchingFontDescriptors fails: +(define-runtime-path coretext-nullarray "patches/coretext-nullarray.patch") + ;; Enable "symbol" fonts, and fix off-by-one: (define-runtime-path win32text-patch "patches/win32text.patch") @@ -441,6 +444,7 @@ "--with-dynamic-modules=no")) #:patches (list coretext-patch coretext-fontreg-patch + coretext-nullarray win32text-patch))] [("gmp") (config #:patches (if gcc-4.0? (list gmp-weak-patch) null) #:configure (append diff --git a/racket/src/native-libs/patches/coretext-nullarray.patch b/racket/src/native-libs/patches/coretext-nullarray.patch new file mode 100644 index 0000000000..da247c600b --- /dev/null +++ b/racket/src/native-libs/patches/coretext-nullarray.patch @@ -0,0 +1,21 @@ +diff -r -u old/pango-1.36.6/pango/pangocoretext-fontmap.c new/pango-1.36.6/pango/pangocoretext-fontmap.c +--- old/pango-1.36.6/pango/pangocoretext-fontmap.c 2015-11-07 08:15:41.000000000 -0700 ++++ new/pango-1.36.6/pango/pangocoretext-fontmap.c 2015-11-07 08:16:56.000000000 -0700 +@@ -649,7 +649,7 @@ + + italic_faces = g_hash_table_new (g_direct_hash, g_direct_equal); + +- count = CFArrayGetCount (ctfaces); ++ count = (ctfaces ? CFArrayGetCount (ctfaces) : 0); + for (i = 0; i < count; i++) + { + PangoCoreTextFace *face; +@@ -669,7 +669,7 @@ + + CFRelease (font_descriptors); + CFRelease (attributes); +- CFRelease (ctfaces); ++ if (ctfaces) CFRelease (ctfaces); + + /* For all fonts for which a non-synthetic italic variant does + * not exist on the system, we create synthesized versions here.