Nikolay Sivov : riched20: Handle invalid HFONT values passed to WM_SETFONT.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 5 10:30:26 CDT 2015
Module: wine
Branch: master
Commit: 20f4a9ff7b1cf4f4e2ddfc11f4fce44293268e57
URL: http://source.winehq.org/git/wine.git/?a=commit;h=20f4a9ff7b1cf4f4e2ddfc11f4fce44293268e57
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Oct 5 00:40:16 2015 +0300
riched20: Handle invalid HFONT values passed to WM_SETFONT.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/riched20/editor.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index a55a109..ae4a3ab 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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);
More information about the wine-cvs
mailing list