riched20: Handle invalid HFONT values passed to WM_SETFONT.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2015-10-05 00:40:16 +03:00 committed by Alexandre Julliard
parent 30c5f3bd63
commit 20f4a9ff7b
1 changed files with 4 additions and 1 deletions

View File

@ -3767,7 +3767,10 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if (!wParam)
wParam = (WPARAM)GetStockObject(SYSTEM_FONT);
GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf);
if (!GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf))
return 0;
hDC = ITextHost_TxGetDC(editor->texthost);
ME_CharFormatFromLogFont(hDC, &lf, &fmt);
ITextHost_TxReleaseDC(editor->texthost, hDC);