Fixes segfault in dtprintinfo when used UTF-8 locale, bug was caused by unchecked return value of XmeRenderTableGetDefaultFont()

This commit is contained in:
Eugene Doudine
2014-02-21 13:52:25 +02:00
committed by Jon Trulson
parent 4c56765da3
commit 23e217b329
2 changed files with 9 additions and 4 deletions

View File

@@ -96,7 +96,7 @@ static XrmOptionDescRec options[] =
};
extern "C" {
extern void XmeRenderTableGetDefaultFont(XmFontList, XFontStruct **);
extern Boolean XmeRenderTableGetDefaultFont(XmFontList, XFontStruct **);
}
Application::Application(char *name,
@@ -151,9 +151,12 @@ Application::Application(char *name,
{
XmFontType _type_return;
fs = (XFontStruct *)XmFontListEntryGetFont(entry, &_type_return);
if (_type_return != XmFONT_IS_FONT)
if (_type_return != XmFONT_IS_FONT) {
XmeRenderTableGetDefaultFont(userFont, &fs);
font = fs->fid;
}
if (fs) {
font = fs->fid;
}
}
XmFontListFreeFontContext(context);
}