Lei Zhang : comctl32: Avoid a divide by zero in listview.

Alexandre Julliard julliard at winehq.org
Tue Sep 30 11:16:59 CDT 2008


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

Author: Lei Zhang <thestig at google.com>
Date:   Mon Sep 29 13:38:54 2008 -0700

comctl32: Avoid a divide by zero in listview.

---

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 70555e8..34e6208 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -1713,7 +1713,8 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
 	if(vertInfo.nPage < infoPtr->nItemHeight)
 	  vertInfo.nPage = infoPtr->nItemHeight;
 
-	vertInfo.nPage /= infoPtr->nItemHeight;
+        if (infoPtr->nItemHeight > 0)
+            vertInfo.nPage /= infoPtr->nItemHeight;
     }
     else if (uView != LVS_LIST) /* LVS_ICON, or LVS_SMALLICON */
     {




More information about the wine-cvs mailing list