1
0
Fork 0

Codefix: potential division by zero in midi reader

pull/13829/head
Rubidium 2025-03-14 19:43:53 +01:00 committed by rubidium42
parent 6d0ba270d2
commit f794ee028b
1 changed files with 2 additions and 0 deletions

View File

@ -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;