Don't try to access band data before it's needed

Nikolay Sivov bunglehead at gmail.com
Thu Feb 11 13:40:15 CST 2010


---
 dlls/comctl32/rebar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 21aabfa..cc06425 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -2919,7 +2919,6 @@ REBAR_PushChevron(const REBAR_INFO *infoPtr, UINT uBand, LPARAM lParam)
 static LRESULT
 REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
 {
-    REBAR_BAND *lpBand;
     UINT htFlags;
     INT iHitBand;
     POINT ptMouseDown;
@@ -2927,7 +2926,6 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
     ptMouseDown.y = (short)HIWORD(lParam);
 
     REBAR_InternalHitTest(infoPtr, &ptMouseDown, &htFlags, &iHitBand);
-    lpBand = REBAR_GetBand(infoPtr, iHitBand);
 
     if (htFlags == RBHT_CHEVRON)
     {
@@ -2935,8 +2933,12 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
     }
     else if (htFlags == RBHT_GRABBER || htFlags == RBHT_CAPTION)
     {
+        REBAR_BAND *lpBand;
+
         TRACE("Starting drag\n");
 
+        lpBand = REBAR_GetBand(infoPtr, iHitBand);
+
         SetCapture (infoPtr->hwndSelf);
         infoPtr->iGrabbedBand = iHitBand;
 
-- 
1.5.6.5


--=-DQGxzaaU+3n809J6KKwA--




More information about the wine-patches mailing list