From 74c8117a4b2d8978a9dde96961a65c61ba090686 Mon Sep 17 00:00:00 2001 From: Adam Petaccia Date: Wed, 27 Aug 2008 17:22:12 -0400 Subject: [PATCH] gdiplus: Don't create a font if there is no facename. --- dlls/gdiplus/font.c | 3 +++ dlls/gdiplus/tests/font.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 9d37077ebcc..ef62ccb8b10 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -169,6 +169,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, if(!logfont || !font) return InvalidParameter; + if (logfont->lfFaceName[0] == 0) + return NotTrueTypeFont; + *font = GdipAlloc(sizeof(GpFont)); if(!*font) return OutOfMemory; diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index b3961419f07..ab6d28c720b 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -112,9 +112,7 @@ static void test_logfont(void) lfw.lfFaceName[0] = 0; stat = GdipCreateFontFromLogfontW(hdc, &lfw, &font); -todo_wine { expect(NotTrueTypeFont, stat); -} memcpy(&lfw.lfFaceName, arial, 6 * sizeof(WCHAR));