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

S3M requires 6 bytes after last pattern before end of file #95

Open
sfiera opened this issue Aug 1, 2023 · 1 comment
Open

S3M requires 6 bytes after last pattern before end of file #95

sfiera opened this issue Aug 1, 2023 · 1 comment

Comments

@sfiera
Copy link

sfiera commented Aug 1, 2023

The S3M file loader requires patterns to end at least 6 bytes before the end of the file:

if ((!len) || (nInd + len > dwMemLength - 6)

I have some S3M files that lack this padding. They seem to play fine in MilkyTracker, but libmodplug drops the final pattern due to the lack of padding. I cannot find any documentation for why it should be necessary to include.

Is it necessary? Can the - 6 not be simply removed?

@Konstanty
Copy link
Owner

Probably a check could be made to check that len is at least 6 (the size of a MODCOMMAND), in the lines preceding instead. Will look into it.

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

No branches or pull requests

2 participants