qt: fix scrollbar crash applying conv. filter

When applying a conversation filter via context menu on the packet list,
something triggers the scrollbar to redraw when it has a maximum value of 0,
leading to a div-by-0. Guard against that (for now) though there may be a better
long-term fix.

Change-Id: I5fa0cac3e67f50a6c603a6fa10b117de5540d444
Reviewed-on: https://code.wireshark.org/review/9850
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Evan Huus 2015-08-02 09:12:23 -04:00 committed by Gerald Combs
parent 78ca0af62f
commit 7c46b25927
1 changed files with 1 additions and 1 deletions

View File

@ -1293,7 +1293,7 @@ void PacketList::drawNearOverlay()
int cur_line = 0;
int start = 0;
if (packet_list_model_->rowCount() > o_height) {
if (packet_list_model_->rowCount() > o_height && overlay_sb_->maximum() > 0) {
start += ((double) overlay_sb_->value() / overlay_sb_->maximum()) * (packet_list_model_->rowCount() - o_rows);
}
int end = start + o_rows;