--- fcxml-Original.c 2013-10-11 05:10:18 +0200 +++ fcxml.c 2014-02-15 17:09:42 +0200 @@ -1998,6 +1998,7 @@ if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0) prefix = FcConfigXdgDataHome (); data = FcStrBufDoneStatic (&parse->pstack->str); + if (!data) { FcConfigMessage (parse, FcSevereError, "out of memory"); @@ -2056,6 +2057,7 @@ } else if (strcmp ((const char *) data, "WINDOWSFONTDIR") == 0) { + int rc; data = buffer; rc = pGetSystemWindowsDirectory ((LPSTR) buffer, sizeof (buffer) - 20); @@ -3092,8 +3094,8 @@ pSHGetFolderPathA = (pfnSHGetFolderPathA) GetProcAddress(hSh, "SHGetFolderPathA"); } #endif - filename = FcConfigFilename (name); + if (!filename) goto bail0; @@ -3197,7 +3199,12 @@ if (name) FcConfigMessage (0, FcSevereError, "Cannot load config file \"%s\"", name); else +#ifdef _WIN32 + fprintf (stderr, + "Fontconfig warning: Cannot find default fonts.conf config file anywhere: Defaulting to Windows font directory\n"); +#else FcConfigMessage (0, FcSevereError, "Cannot load default config file"); +#endif return FcFalse; } return FcTrue;