From a89731a78c8cb019a18d2e70fe43d21286d88ab1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Nov 2021 17:09:51 +0200 Subject: [PATCH] Avoid assertion violations in --enable-checking builds * src/xdisp.c (gui_produce_glyphs): Make sure character glyphs don't trigger assertion violation due to negative ascent or descent. This was reporte dto happen with some fonts used by the xfont backend. --- src/xdisp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 24049ab4e33..9f93799783d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -31199,6 +31199,11 @@ gui_produce_glyphs (struct it *it) it->max_ascent = max (it->max_ascent, font_ascent); it->max_descent = max (it->max_descent, font_descent); } + + if (it->ascent < 0) + it->ascent = 0; + if (it->descent < 0) + it->descent = 0; } else if (it->what == IT_COMPOSITION && it->cmp_it.ch < 0) { -- 2.39.5