ValleyBell / libvgm

A more modular rewrite of most components from VGMPlay. will include sub-libraries for audio output, sound emulation and VGM playback
irc://irc.digibase.ca/#vgmrips
136 stars 33 forks source link

VGMPlayer::ParseFileForFMClocks: handle command 0x63 correctly #121

Closed FraGag closed 1 month ago

FraGag commented 1 month ago

0x63 was treated as having a 1-byte parameter but it actually has no parameters. This could advance the file position to a command parameter rather than a command. This could trigger the return in the default case. Therefore, a VGM 1.01 file that uses the YM2612 or the YM2151 (instead of the YM2413) could be rendered as silence because the YM2612/YM2151 clock rate could remain set to 0.

To fix this, we can just remove the cases for commands 0x50, 0x61, and 0x63 because the default case handles them just fine.

ValleyBell commented 1 month ago

Good catch - thanks a lot!