Eric Pouech : richedit: Check return of GetScrollInfo before accessing the returned structure.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 08:39:05 CST 2008


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

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Fri Jan  4 21:12:14 2008 +0100

richedit: Check return of GetScrollInfo before accessing the returned structure.

---

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

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 91e283a..03a588c 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -697,8 +697,7 @@ int ME_GetYScrollPos(ME_TextEditor *editor)
   SCROLLINFO si;
   si.cbSize = sizeof(si);
   si.fMask = SIF_POS;
-  GetScrollInfo(editor->hWnd, SB_VERT, &si);
-  return si.nPos;
+  return GetScrollInfo(editor->hWnd, SB_VERT, &si) ? si.nPos : 0;
 }
 
 BOOL ME_GetYScrollVisible(ME_TextEditor *editor)




More information about the wine-cvs mailing list