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

Fix getting length from libopenmpt as infinity, which could crash with Protracker modules #1389

Merged
merged 4 commits into from
Jan 14, 2025

Conversation

C0rn3j
Copy link
Collaborator

@C0rn3j C0rn3j commented Jan 14, 2025

Handle passing infinity to get_display_time() by logging an error and parsing ??:?? back, this fixes an instant crash should we supply such a file that manages to get mangled by tag_scan() as such.

Also handle the root cause that was causing this - we were not handling a possible infinity libopenmpt can throw if it fails to parse the file length.

Upstream report - https://bugs.openmpt.org/view.php?id=1857

Also fix typing for the function and add some small touchups.

Repro broken .mod file was posted in https://discord.com/channels/687418493209018622/915799586168270878/1328664124254715934

@C0rn3j C0rn3j marked this pull request as ready for review January 14, 2025 17:19
@C0rn3j C0rn3j changed the title Handle broken track length better Fix getting length from libopenmpt as infinity, which could crash with Protracker modules Jan 14, 2025
@Taiko2k Taiko2k merged commit 837fe1d into Taiko2k:master Jan 14, 2025
4 checks passed
@C0rn3j C0rn3j deleted the toinfinityandbeyond branch January 14, 2025 22:02
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