b932b10f
by Eric Tian at 2025-04-02T17:11:52+02:00
gdiplus: Avoid storing NULL in gdip_font_link_section.
In generate_font_link_info, because the return value of
GdipCreateFontFromDC is not checked, section->font might be set to NULL.
GdipMeasureString calls gdip_format_string, which then calls
generate_font_link_info and font_link_get_text_extent_point. In
font_link_get_text_extent_point, the font from gdip_font_link_section is also
not checked for NULL, which may cause a crash.
Therefore, in generate_font_link_info, when GdipCreateFontFromDC fails,
store (GpFont *)base_font (as with IMLangFontLink_MapFont failure) to ensure
the font in gdip_font_link_section is valid.