Jason Green : riched20: If outside of the richedit window, return earlier.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 15 05:27:56 CST 2007


Module: wine
Branch: master
Commit: 2aa8463a94586da94d9f4cab902f5ef68a5e6563
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2aa8463a94586da94d9f4cab902f5ef68a5e6563

Author: Jason Green <jave27 at gmail.com>
Date:   Wed Feb 14 23:40:52 2007 -0500

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(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 783e91d..c9e9246 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2597,6 +2597,8 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam
   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;
 




More information about the wine-cvs mailing list