From: Eli Zaretskii Date: Thu, 27 May 2021 14:15:53 +0000 (+0300) Subject: ; * src/character.c (lisp_string_width): Another defensive fix. X-Git-Tag: emacs-28.0.90~2308 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f1c3b82d401eecd1facbe0a6c07ccde100ad65d8;p=emacs.git ; * src/character.c (lisp_string_width): Another defensive fix. --- diff --git a/src/character.c b/src/character.c index e72fdc0c4bd..60424fab71e 100644 --- a/src/character.c +++ b/src/character.c @@ -394,9 +394,12 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to, SBYTES (default_font)))) { Lisp_Object font_info = Ffont_info (default_font, Qnil); - font_width = XFIXNUM (AREF (font_info, 11)); - if (font_width <= 0) - font_width = XFIXNUM (AREF (font_info, 10)); + if (VECTORP (font_info)) + { + font_width = XFIXNUM (AREF (font_info, 11)); + if (font_width <= 0) + font_width = XFIXNUM (AREF (font_info, 10)); + } } } thiswidth = (double) pixelwidth / font_width + 0.5;