[PATCH] riched20: Handle invalid HFONT values passed to WM_SETFONT

Nikolay Sivov nsivov at codeweavers.com
Sun Oct 4 16:40:16 CDT 2015


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

Fixes https://bugs.winehq.org/show_bug.cgi?id=34167

 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);
-- 
2.5.3




More information about the wine-patches mailing list