]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-31 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 31 Jan 2010 00:26:11 +0000 (01:26 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 31 Jan 2010 00:26:11 +0000 (01:26 +0100)
* font/font.c (find_glyph): Check that bmp_idx is available before
using it.
(grub_font_get_string_width): Never call grub_font_get_glyph_internal
with (font == NULL).

ChangeLog
font/font.c

index f0d88159937e5410bfb803bfa8fd6aed82aef293..eced79d5995dc5b29dba4e6497d9fc3b769a25ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-31  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * font/font.c (find_glyph): Check that bmp_idx is available before
+       using it.
+       (grub_font_get_string_width): Never call grub_font_get_glyph_internal
+       with (font == NULL).
+
 2010-01-28  Christian Schmitt  <chris@ilovelinux.de>
 
         * util/ieee1275/grub-install.in: Fix nvsetenv arguments.
index 639f4d7204e7ab5a4d8dbe2898e02e38682c4205..16f2ed35bf04cc8781307bc1b0595ef1d8ac08a0 100644 (file)
@@ -668,7 +668,7 @@ find_glyph (const grub_font_t font, grub_uint32_t code)
   table = font->char_index;
 
   /* Use BMP index if possible.  */
-  if (code < 0x10000)
+  if (code < 0x10000 && font->bmp_idx)
     {
       if (font->bmp_idx[code] == 0xffff)
        return 0;
@@ -942,8 +942,9 @@ grub_font_get_string_width (grub_font_t font, const char *str)
 struct grub_font_glyph *
 grub_font_get_glyph (grub_font_t font, grub_uint32_t code)
 {
-  struct grub_font_glyph *glyph;
-  glyph = grub_font_get_glyph_internal (font, code);
+  struct grub_font_glyph *glyph = 0;
+  if (font)
+    glyph = grub_font_get_glyph_internal (font, code);
   if (glyph == 0)
     {
       glyph = ascii_glyph_lookup (code);