From 966ff672fc69205f840f6665b85c6e7375b9e785 Mon Sep 17 00:00:00 2001
From: Sambuddha Basu <sambuddhabasu1@gmail.com>
Date: Thu, 29 Jan 2015 22:54:42 +0530
Subject: [PATCH] Issue 11111 - Division by zero in TabDecorator
---
src/servers/app/decorator/TabDecorator.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/servers/app/decorator/TabDecorator.cpp b/src/servers/app/decorator/TabDecorator.cpp
index 0d295a0..68b781b 100644
a
|
b
|
TabDecorator::_DoTabLayout()
|
406 | 406 | void |
407 | 407 | TabDecorator::_DistributeTabSize(float delta) |
408 | 408 | { |
409 | | ASSERT(CountTabs() > 1); |
| 409 | int32 tabCount = fTabList.CountItems(); |
| 410 | ASSERT(tabCount > 1); |
410 | 411 | |
411 | 412 | float maxTabSize = 0; |
412 | 413 | float secMaxTabSize = 0; |
413 | 414 | int32 nTabsWithMaxSize = 0; |
414 | | for (int32 i = 0; i < fTabList.CountItems(); i++) { |
| 415 | for (int32 i = 0; i < tabCount; i++) { |
415 | 416 | Decorator::Tab* tab = fTabList.ItemAt(i); |
| 417 | |
| 418 | if (tab == NULL) |
| 419 | continue; |
| 420 | |
416 | 421 | float tabWidth = tab->tabRect.Width(); |
417 | 422 | if (int_equal(maxTabSize, tabWidth)) { |
418 | 423 | nTabsWithMaxSize++; |