mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-23 21:50:23 +01:00
Codefix: potential division by zero in midi reader
This commit is contained in:
parent
6d0ba270d2
commit
f794ee028b
@ -458,6 +458,8 @@ bool MidiFile::LoadFile(const std::string &filename)
|
||||
if (header.format != 0 && header.format != 1) return false;
|
||||
/* Doesn't support SMPTE timecode files */
|
||||
if ((header.tickdiv & 0x8000) != 0) return false;
|
||||
/* Ticks per beat / parts per quarter note should not be zero. */
|
||||
if (header.tickdiv == 0) return false;
|
||||
|
||||
this->tickdiv = header.tickdiv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user