[riched20 2/2] riched20: If outside of the richedit window, return earlier.

Jason Green jave27 at gmail.com
Wed Feb 14 22:40:52 CST 2007


Prevents a crash when selecting text outside of a richedit control box.

----
Jason Green
TransGaming Technologies, Inc.
-------------- next part --------------
From nobody Mon Sep 17 00:00:00 2001
From: Jason <jason at jave02.(none)>
Date: Wed, 14 Feb 2007 23:33:56 -0500
Subject: [PATCH 2/2] riched20: If outside of the richedit window, return earlier.

Prevents a crash when selecting text outside of a richedit control box.

---

 dlls/riched20/editor.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

a068431ae8075e62e2ee2744b4380d6326bf85a6
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 8293e4d..cbdd24a 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2599,6 +2599,8 @@ void ME_LinkNotify(ME_TextEditor *editor
   x = (short)LOWORD(lParam);
   y = (short)HIWORD(lParam);
   nCharOfs = ME_CharFromPos(editor, x, y);
+  if (nCharOfs < 0) return;
+
   ME_CursorFromCharOfs(editor, nCharOfs, &tmpCursor);
   tmpRun = &tmpCursor.pRun->member.run;
 
-- 
1.3.3


More information about the wine-patches mailing list