7058808 Running 'fc-match --all' core dumps when no fonts are installed
authorArvind Umrao <Arvind.Umrao@Sun.COM>
Thu, 07 Jul 2011 09:10:41 -0700
changeset 1160 e1a0d8b6903e
parent 1159 b49e24485bb6
child 1161 92cb0ee2804d
7058808 Running 'fc-match --all' core dumps when no fonts are installed
open-src/lib/fontconfig/7058808.patch
open-src/lib/fontconfig/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/lib/fontconfig/7058808.patch	Thu Jul 07 09:10:41 2011 -0700
@@ -0,0 +1,17 @@
+CR 7058808 fc-match core dumps when no fonts are installed. FcFonSort interface returns Null.
+
+--- fc-match/fc-match.c	Wed Jun 29 15:00:37 2011
++++ fc-match/fc-match.c	Wed Jun 29 15:04:43 2011
+@@ -174,6 +174,12 @@
+ 	FcFontSet	*font_patterns;
+ 	int	j;
+ 	font_patterns = FcFontSort (0, pat, all ? FcFalse : FcTrue, 0, &result);
++	
++	if (!font_patterns)
++    	{
++            fprintf (stderr, "Can't find any matching font\n");
++            return 1;
++    	}
+ 
+ 	for (j = 0; j < font_patterns->nfont; j++)
+ 	{
--- a/open-src/lib/fontconfig/Makefile	Thu Jul 07 08:33:27 2011 -0700
+++ b/open-src/lib/fontconfig/Makefile	Thu Jul 07 09:10:41 2011 -0700
@@ -77,7 +77,8 @@
 		bitmap-hacks.patch \
 		6447517.patch \
 		6770058.patch \
-		7026635.patch
+		7026635.patch \
+		7058808.patch
 
 # Library name (used for specfiles/mapfiles)
 LIBNAME=fontconfig