summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-12 14:46:39 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-12 14:46:39 +0300
commit7792fb11e68ada6b7005637727986d12cbd0e1dc (patch)
tree74e6dc7e32feca24b8e4492adabdce0c06ae215b
parenteffaf34cd34a5c9bb6b463d678509879f7fbd88d (diff)
downloadplus-7792fb11e68ada6b7005637727986d12cbd0e1dc.tar.gz
plus-7792fb11e68ada6b7005637727986d12cbd0e1dc.tar.bz2
plus-7792fb11e68ada6b7005637727986d12cbd0e1dc.tar.xz
plus-7792fb11e68ada6b7005637727986d12cbd0e1dc.zip
fix possible division by zero in guitable.
-rw-r--r--src/gui/widgets/guitable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 9d6eb0926..090588f90 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -314,7 +314,9 @@ void GuiTable::draw(gcn::Graphics* graphics)
// First, determine how many rows we need to draw,
// and where we should start.
- const int rHeight = getRowHeight();
+ int rHeight = getRowHeight();
+ if (!rHeight)
+ rHeight = 1;
int first_row = -(y / rHeight);
if (first_row < 0)