# HG changeset patch # User reimar # Date 1225619842 0 # Node ID 29d72a47da0c5c6f2831673c06699f0038e96fa6 # Parent 0073bd1837871fe0d9553a6d94a8e73c13181f48 Fallback to non-fontconfig behaviour when fontconfig initialization fails. Also fixes a memleak in that case, bug #1313. diff -r 0073bd183787 -r 29d72a47da0c libass/ass_fontconfig.c --- a/libass/ass_fontconfig.c Sat Nov 01 13:56:11 2008 +0000 +++ b/libass/ass_fontconfig.c Sun Nov 02 09:57:22 2008 +0000 @@ -407,10 +407,7 @@ if (!fc) { mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed); - priv->config = NULL; - priv->path_default = strdup(path); - priv->index_default = 0; - return priv; + goto exit; } rc = FcInit(); @@ -419,7 +416,7 @@ priv->config = FcConfigGetCurrent(); if (!priv->config) { mp_msg(MSGT_ASS, MSGL_FATAL, MSGTR_LIBASS_FcInitLoadConfigAndFontsFailed); - return 0; + goto exit; } for (i = 0; i < library->num_fontdata; ++i) @@ -468,6 +465,7 @@ } priv->family_default = family ? strdup(family) : 0; +exit: priv->path_default = path ? strdup(path) : 0; priv->index_default = 0;