From d3608cf4b2e08c843f2b914cbd8eeeea8510334e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Zalewski?= Date: Thu, 6 Mar 2008 22:06:21 +0100 Subject: [PATCH] comctl32: rebar: Fix SizeToHeight when no bands visible. --- dlls/comctl32/rebar.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 9a3f8d5f1c8..f1f823a17fe 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -1442,6 +1442,9 @@ REBAR_SizeToHeight(REBAR_INFO *infoPtr, int height) UINT uNumRows = infoPtr->uNumRows; int i; + if (uNumRows == 0) /* avoid division by 0 */ + return; + /* That's not exactly what Windows does but should be similar */ /* Pass one: break-up/glue rows */