[Gdiplus 3/6] Fix Valgrind Warnings

Adam Petaccia adam at tpetaccia.com
Fri Jun 27 19:12:31 CDT 2008


---
 dlls/gdiplus/font.c       |    3 +++
 dlls/gdiplus/tests/font.c |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 43bde5d..6e108a3 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -371,6 +371,9 @@ GpStatus WINGDIPAPI
GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
 
     hdc = GetDC(0);
     lstrcpynW(lfw.lfFaceName, name, sizeof(WCHAR) * LF_FACESIZE);
+    lfw.lfCharSet = DEFAULT_CHARSET;
+    lfw.lfEscapement = lfw.lfOrientation = 0;
+
     hFont = CreateFontIndirectW (&lfw);
     hfont_old = SelectObject(hdc, hFont);
 
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index 90fce18..ffa605f 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -152,6 +152,8 @@ static void test_fontfamily (void)
     WCHAR itsName[LF_FACESIZE];
     GpStatus stat;
 
+    ZeroMemory(itsName, sizeof(itsName));
+
     /* FontFamily can not be NULL */
     stat = GdipCreateFontFamilyFromName (arial , NULL, family);
     expect (InvalidParameter, stat);
-- 
1.5.4.3





More information about the wine-patches mailing list