mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 05:55:31 +02:00
Fix division by zero segfault (#28)
Bug was introduced in c9378cfaba
Thanks to Eblog for reporting the bug.
This commit is contained in:
parent
fae7fa9c4e
commit
f46e132945
1 changed files with 7 additions and 0 deletions
|
@ -728,6 +728,13 @@ struct InputPrivate
|
|||
} dir8Data;
|
||||
|
||||
void recalcRepeatTime(unsigned int fps) {
|
||||
// 0 fps would cause a divide by zero segfault later.
|
||||
// Bail in that case.
|
||||
if (fps == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double framems = 1.f / fps;
|
||||
|
||||
// Approximate time in milliseconds
|
||||
|
|
Loading…
Add table
Reference in a new issue