- 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.

svn path=/trunk/; revision=36092
This commit is contained in:
Colin Finck 2008-09-09 17:49:23 +00:00
parent 0abf5b122d
commit bdf36ed7e5

View file

@ -391,12 +391,17 @@ int STDCALL
EnumFontFamiliesExA (HDC hdc, LPLOGFONTA lpLogfont, FONTENUMPROCA lpEnumFontFamExProc,
LPARAM lParam, DWORD dwFlags)
{
LOGFONTW LogFontW;
LOGFONTW LogFontW, *pLogFontW;
LogFontA2W(&LogFontW, lpLogfont);
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);
}