From: Eli Zaretskii Date: Sat, 27 Nov 2021 15:09:51 +0000 (+0200) Subject: Avoid assertion violations in --enable-checking builds X-Git-Tag: emacs-29.0.90~3649^2~22 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a89731a78c8cb019a18d2e70fe43d21286d88ab1;p=emacs.git 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. --- 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) {