mirror of https://github.com/OpenTTD/OpenTTD
Codefix: potential division by zero in midi reader
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