Commit 20f4a9ff authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

riched20: Handle invalid HFONT values passed to WM_SETFONT.

parent 30c5f3bd
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment