libmodplug icon indicating copy to clipboard operation
libmodplug copied to clipboard

S3M requires 6 bytes after last pattern before end of file

Open sfiera opened this issue 2 years ago • 1 comments

The S3M file loader requires patterns to end at least 6 bytes before the end of the file: https://github.com/Konstanty/libmodplug/blob/d1b97ed0020bc620a059d3675d1854b40bd2608d/src/load_s3m.cpp#L347

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?

sfiera avatar Aug 01 '23 13:08 sfiera

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.

Konstanty avatar Aug 03 '23 00:08 Konstanty