DtHelp: Apply graceful degradation for font loading to avoid a segmentation

fault.
This commit is contained in:
Liang Chang
2021-05-22 00:10:48 +08:00
parent 6f952545fb
commit a9ceb6db7a
4 changed files with 36 additions and 2 deletions

View File

@@ -849,10 +849,17 @@ ResolveFont (
if (charset != NULL)
xrmList[_DT_HELP_FONT_CHAR_SET] = XrmStringToQuark(charset);
if (NULL == xlfdSpec ||
_DtHelpGetExactFontIndex(pDAS,lang,charset,xlfdSpec,ret_idx)!=0)
if (NULL != xlfdSpec)
result = _DtHelpGetExactFontIndex(pDAS,lang,charset,xlfdSpec,ret_idx);
if (result)
result = __DtHelpFontIndexGet (pDAS, xrmList, ret_idx);
if (result) {
_DtHelpCopyCasualList(xrmList);
result = __DtHelpFontIndexGet(pDAS, xrmList, ret_idx);
}
return result;
}