Fix blatant segfault in x11_font_has_glyph.

When I cut it in half so I could fetch the XCharStruct for a given
character, I forgot that the remaining half should check whether it
had got NULL from the XCharStruct finder. Ahem.
This commit is contained in:
Simon Tatham 2016-03-20 19:55:22 +00:00
Родитель ece38fbb21
Коммит eb4730e0bf
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -350,7 +350,7 @@ static int x11_font_has_glyph(XFontStruct *xfs, int byte1, int byte2)
* which glyphs _are_ missing.
*/
const XCharStruct *xcs = x11_char_struct(xfs, byte1, byte2);
return (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
return xcs && (xcs->ascent + xcs->descent > 0 || xcs->width > 0);
}
static unifont *x11font_create(GtkWidget *widget, const char *name,