Author: cfinck
Date: Tue Sep 9 12:49:23 2008
New Revision: 36092
URL:
http://svn.reactos.org/svn/reactos?rev=36092&view=rev
Log:
Giannis Adamopoulos (johnyadams(a)hotmail.com)
- Check if lpLogFont is NULL, so we don't crash if it is.
Verified by the GDI32 Wine test, which explicitly checks for this behaviour and
doesn't crash under WinXP SP2.
See issue #3725 for more details.
Modified:
trunk/reactos/dll/win32/gdi32/objects/font.c
Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Tue Sep 9 12:49:23 2008
@@ -391,12 +391,17 @@
EnumFontFamiliesExA (HDC hdc, LPLOGFONTA lpLogfont, FONTENUMPROCA lpEnumFontFamExProc,
LPARAM lParam, DWORD dwFlags)
{
- LOGFONTW LogFontW;
-
- LogFontA2W(&LogFontW, lpLogfont);
+ LOGFONTW LogFontW, *pLogFontW;
+
+ if (lpLogfont)
+ {
+ LogFontA2W(&LogFontW,lpLogfont);
+ pLogFontW = &LogFontW;
+ }
+ else pLogFontW = NULL;
/* no need to convert LogFontW back to lpLogFont b/c it's an [in] parameter only
*/
- return IntEnumFontFamilies(hdc, &LogFontW, lpEnumFontFamExProc, lParam, FALSE);
+ return IntEnumFontFamilies(hdc, pLogFontW, lpEnumFontFamExProc, lParam, FALSE);
}