jdk/src/java.desktop/unix/native/common/awt/fontpath.c
changeset 32289 e7e19bfe2948
parent 29513 643ff69483e8
child 33862 b6440f7dfb84
--- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Thu Aug 13 16:26:17 2015 +0300
+++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c	Thu Aug 13 12:12:10 2015 -0700
@@ -1219,10 +1219,11 @@
                 minGlyphs = val;
             }
         }
+        FcCharSet *unionCharset = NULL;
         for (j=0; j<nfonts; j++) {
             FcPattern *fontPattern = fontset->fonts[j];
             FcChar8 *fontformat;
-            FcCharSet *unionCharset = NULL, *charset;
+            FcCharSet *charset = NULL;
 
             fontformat = NULL;
             (*FcPatternGetString)(fontPattern, FC_FONTFORMAT, 0, &fontformat);
@@ -1280,6 +1281,9 @@
             if (!includeFallbacks) {
                 break;
             }
+            if (fontCount == 254) {
+                break; // CompositeFont will only use up to 254 slots from here.
+            }
         }
 
         /* Once we get here 'fontCount' is the number of returned fonts