]> git.ipfire.org Git - thirdparty/grub.git/commit
font: Assign null_font to glyphs in ascii_font_glyph[]
authorZhang Boyang <zhangboyang.id@gmail.com>
Fri, 28 Oct 2022 09:29:16 +0000 (17:29 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Nov 2022 19:24:39 +0000 (20:24 +0100)
commit22b77b87e10a3a6c9bb9885415bc9a9c678378e6
tree9c82815a790cda4c9d843cee67911c6c0ef21600
parent9d81f71c6b8f55cf20cd56f5fe29c759df9b48cc
font: Assign null_font to glyphs in ascii_font_glyph[]

The calculations in blit_comb() need information from glyph's font, e.g.
grub_font_get_xheight(main_glyph->font). However, main_glyph->font is
NULL if main_glyph comes from ascii_font_glyph[]. Therefore
grub_font_get_*() crashes because of NULL pointer.

There is already a solution, the null_font. So, assign it to those glyphs
in ascii_font_glyph[].

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/font/font.c