app: check that the font path is not NULL.
This is for Windows where we apparently need to call
g_win32_locale_filename_from_utf8() before feeding the path to
FcConfigAppFontAddFile().
Unfortunately as we discovered earlier (cf. commit ba06a0fe86), this
can sometimes return NULL. So we absolutely need to check for the path
not being NULL first.
This commit is contained in:
@ -307,10 +307,15 @@ gimp_fonts_recursive_add_fontdir (FcConfig *config,
|
||||
gchar *tmp = g_win32_locale_filename_from_utf8 (path);
|
||||
|
||||
g_free (path);
|
||||
/* XXX: g_win32_locale_filename_from_utf8() may return
|
||||
* NULL. So we need to check that path is not NULL before
|
||||
* trying to load with fontconfig.
|
||||
*/
|
||||
path = tmp;
|
||||
#endif
|
||||
|
||||
if (FcFalse == FcConfigAppFontAddFile (config, (const FcChar8 *) path))
|
||||
if (! path ||
|
||||
FcFalse == FcConfigAppFontAddFile (config, (const FcChar8 *) path))
|
||||
{
|
||||
g_printerr ("%s: adding font file '%s' failed.\n",
|
||||
G_STRFUNC, path);
|
||||
|
||||
Reference in New Issue
Block a user