djtuBIG-MaliceX / opl3-synth-driver

Forked from Alexey Khohkolov's (khokh2001) OPL3 synth. This intends to improve onto the base driver to include extended MIDI support and other improvements to the playback component.
5 stars 0 forks source link

Certain complex MIDI files are causing crashes. #10

Closed djtuBIG-MaliceX closed 10 years ago

djtuBIG-MaliceX commented 10 years ago

Original report by James Alan Nguyen (Bitbucket: djtubig-malicex, GitHub: djtubig-malicex).


eg: some vgm2mid conversions, Teck's Plok_BreezyBeach.mid, among others.

Need to determine root cause of the crash. Most likely a DIV0 or bad memory access due to race condition.

djtuBIG-MaliceX commented 10 years ago

Original comment by James Alan Nguyen (Bitbucket: djtubig-malicex, GitHub: djtubig-malicex).


Need further investigation. Causing m_iBendRange[n] to be set to 0, causing a divide by zero. Good chance of memory corruption happening at runtime.

djtuBIG-MaliceX commented 10 years ago

Original comment by James Alan Nguyen (Bitbucket: djtubig-malicex, GitHub: djtubig-malicex).


Fixed. Turned out blank patches were being parsed as 4-Op patches instead of being ignored, which in turn called Opl3_FindEmptySlot4Op(), which was buggy in that it attempted to access an array offset beyond its length.