]> granicus.if.org Git - php/commitdiff
- MFB: #43790, fix crash when no family name has been found
authorPierre Joye <pajoye@php.net>
Wed, 9 Jan 2008 01:51:17 +0000 (01:51 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 9 Jan 2008 01:51:17 +0000 (01:51 +0000)
ext/gd/libgd/gdft.c

index 49a540c421b0c6ae4802fea1b7e0717b2edf8a3c..e543f2fe2b0e8c78222a5a5834ed1eb5b26463e5 100644 (file)
@@ -947,7 +947,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
 
 /* EAM DEBUG */
 #if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
-               if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL && strcmp(font->face->family_name, "Symbol") == 0) {
+               if (font->face->family_name && font->face->charmap->encoding &&
+                       font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL && strcmp(font->face->family_name, "Symbol") == 0) {
                        /* I do not know the significance of the constant 0xf000.
                         * It was determined by inspection of the character codes
                         * stored in Microsoft font symbol.