From 309c2da98a4c739bcdabc3a80610d86a40ce12e6 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 20 Nov 2022 13:56:15 -0500 Subject: add check for missing glyph in XftFontCheckGlyph() This check is needed when updating the linked list of glyphs, since the older/newer links are not set, causing an xterm crash for certain fonts which have holes (e.g., Kochi Mincho). reported by Jeff Chua Signed-off-by: Thomas E. Dickey --- src/xftglyphs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xftglyphs.c b/src/xftglyphs.c index 3a3dfd2..bb9057e 100644 --- a/src/xftglyphs.c +++ b/src/xftglyphs.c @@ -1245,8 +1245,11 @@ XftFontCheckGlyph (Display *dpy, /* * Make unloading faster by moving newly-referenced glyphs to the front * of the list, leaving the less-used glyphs on the end. + * + * If the glyph is zero, the older/newer data may not have been set. */ - if (font->track_mem_usage + if (glyph != 0 + && font->track_mem_usage && font->total_inuse > 10 && font->newest != FT_UINT_MAX && font->newest != glyph) -- cgit v1.2.1