Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

FraGag
Copy link
Contributor

@FraGag FraGag commented Jun 5, 2024

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.

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 ValleyBell merged commit 53aebe9 into ValleyBell:master Jun 5, 2024
8 checks passed
@ValleyBell
Copy link
Owner

Good catch - thanks a lot!

@FraGag FraGag deleted the fixes branch June 6, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants