From 7792fb11e68ada6b7005637727986d12cbd0e1dc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Dec 2013 14:46:39 +0300 Subject: fix possible division by zero in guitable. --- src/gui/widgets/guitable.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-60-g2f50