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

simfile.timing: BeatValues can't handle junk data #4

Open
garcia opened this issue Sep 11, 2021 · 1 comment
Open

simfile.timing: BeatValues can't handle junk data #4

garcia opened this issue Sep 11, 2021 · 1 comment
Labels
fixed-tested-v3 non-strict parsing bugs related to malformed simfiles that StepMania accepts
Milestone

Comments

@garcia
Copy link
Owner

garcia commented Sep 11, 2021

For example, OceanLab Megamix contains spurious control characters in some BPM values. StepMania appears to use the C++ function std::stof to parse each number, which stops when it reaches any character that can't be parsed into the number. The control characters only ever cut off zeros in the decimals, so there is no impact to gameplay in this case. As far as StepMania is concerned, there's nothing wrong with the file.

TimingData, on the other hand, throws an exception when presented with this simfile. This is because Python's Decimal class constructor expects the incoming string data to be clean. We should change our behavior to match StepMania to support this and similar files.

@garcia garcia changed the title BeatValues can't handle junk data simfile.timing: BeatValues can't handle junk data Sep 11, 2021
@garcia garcia added non-strict parsing bugs related to malformed simfiles that StepMania accepts and removed bug good first issue labels Feb 18, 2023
@garcia
Copy link
Owner Author

garcia commented Jun 18, 2024

This should now be fixed on the v3 branch for non-strict-ly parsed simfiles: https://github.com/garcia/simfile/compare/7c8d8c87f4ff29a0fcfdcad9daf9df0f0f57dd4b..eb46093a389146dcdd7ebf61801a2aaff0a507a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-tested-v3 non-strict parsing bugs related to malformed simfiles that StepMania accepts
Projects
None yet
Development

No branches or pull requests

1 participant