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).
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-31 01:26:11 +01:00
parent bf7fcba2d7
commit 61e89d9db6
2 changed files with 11 additions and 3 deletions

View file

@ -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> 2010-01-28 Christian Schmitt <chris@ilovelinux.de>
* util/ieee1275/grub-install.in: Fix nvsetenv arguments. * util/ieee1275/grub-install.in: Fix nvsetenv arguments.

View file

@ -668,7 +668,7 @@ find_glyph (const grub_font_t font, grub_uint32_t code)
table = font->char_index; table = font->char_index;
/* Use BMP index if possible. */ /* Use BMP index if possible. */
if (code < 0x10000) if (code < 0x10000 && font->bmp_idx)
{ {
if (font->bmp_idx[code] == 0xffff) if (font->bmp_idx[code] == 0xffff)
return 0; return 0;
@ -942,8 +942,9 @@ grub_font_get_string_width (grub_font_t font, const char *str)
struct grub_font_glyph * struct grub_font_glyph *
grub_font_get_glyph (grub_font_t font, grub_uint32_t code) grub_font_get_glyph (grub_font_t font, grub_uint32_t code)
{ {
struct grub_font_glyph *glyph; struct grub_font_glyph *glyph = 0;
glyph = grub_font_get_glyph_internal (font, code); if (font)
glyph = grub_font_get_glyph_internal (font, code);
if (glyph == 0) if (glyph == 0)
{ {
glyph = ascii_glyph_lookup (code); glyph = ascii_glyph_lookup (code);