FcInitLoadConfig() could faul, leaving rc=1 and fc->config=NULL, making
FcConfigBuildFonts() potentially crash.
Also, the FcConfigBuildFonts() return value was not checked.
"file found, using fallback.");
FcConfigDestroy(fc->config);
fc->config = FcInitLoadConfig();
- rc++;
}
- if (rc)
- FcConfigBuildFonts(fc->config);
+ if (fc->config)
+ rc = FcConfigBuildFonts(fc->config);
if (!rc || !fc->config) {
ass_msg(lib, MSGL_FATAL,