Opened 22 years ago

Closed 22 years ago

Last modified 6 years ago

#485 closed defect (fixed)

Launcher crashes game

Reported by: SF/trinity78 Owned by: fingolfin
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

Using the latest daily build with Win2k + SDL backend, i noticed a crash when starting scummvm.exe without any parameters. Instead that the launcher is displayed the game crashes with a exception. This is caused by:

ScrollBarWidget.cpp

void ScrollBarWidget::recalc() { _sliderHeight = (_h - 2 * UP_DOWN_BOX_HEIGHT) * _entriesPerPage / _numEntries; if (_sliderHeight < UP_DOWN_BOX_HEIGHT) _sliderHeight = UP_DOWN_BOX_HEIGHT;

_sliderPos = UP_DOWN_BOX_HEIGHT + (_h - 2 * UP_DOWN_BOX_HEIGHT - _sliderHeight) * _currentPos / (_numEntries - _entriesPerPage);

// On startup: _sliderPos = 10 + (112 - 2*10 - 92) * 0 / (10 - 10) // _numEntries and _entriesPerPage have both the value of 10, which causes a divison by zero

if (_sliderPos < 0) _sliderPos = 0; }

as you can see it is a divison by zero which causes the crash.

Ticket imported from: #620854. Ticket imported from: bugs/485.

Change History (2)

comment:1 by fingolfin, 22 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:2 by digitall, 6 years ago

Component: GUI
Note: See TracTickets for help on using tickets.