diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-11-20 13:56:15 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-11-20 14:10:41 -0500 |
commit | 309c2da98a4c739bcdabc3a80610d86a40ce12e6 (patch) | |
tree | b48f49d3f99d3fdfcbe3c94fb470799cfdaf6e39 | |
parent | 1463255cd4f537baabf8f2c65270e4924d4ed656 (diff) | |
download | xorg-lib-libXft-309c2da98a4c739bcdabc3a80610d86a40ce12e6.tar.gz |
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 <dickey@invisible-island.net>
-rw-r--r-- | src/xftglyphs.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |