]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/character.c (lisp_string_width): Another defensive fix.
authorEli Zaretskii <eliz@gnu.org>
Thu, 27 May 2021 14:15:53 +0000 (17:15 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 27 May 2021 14:15:53 +0000 (17:15 +0300)
src/character.c

index e72fdc0c4bd5447054812d7f7c0de5e9a19f6960..60424fab71e6bbaa0ce6734d6c02b19f9e39693a 100644 (file)
@@ -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;