Commit 53371cc5 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

gdiplus/tests: Fix a font test crash when "MS Shell Dlg" is not found.

When "MS Shell Dlg" is missing GdipCreateFontFamilyFromName() leaves the GpFontFamily* pointer uninitialised. So initialize it to NULL in order to get clean failures instead of a crash. Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarEsme Povirk <esme@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ad663360
......@@ -883,8 +883,10 @@ static void test_font_substitution(void)
ok(lstrcmpA(lf.lfFaceName, "MS Shell Dlg") != 0, "expected substitution of MS Shell Dlg\n");
GdipDeleteFont(font);
family = NULL;
status = GdipCreateFontFamilyFromName(L"MS Shell Dlg", NULL, &family);
expect(Ok, status);
font = NULL;
status = GdipCreateFont(family, 12, FontStyleRegular, UnitPoint, &font);
expect(Ok, status);
memset(&lf, 0xfe, sizeof(lf));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment