View Issue Details

IDProjectCategoryView StatusLast Update
0001990OpenMPTFile Format Supportpublic2026-10-11 19:54
ReporterSkyLyrac Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86 / x64OSWineOS Version(version plz)
Product VersionOpenMPT 1.32.11.00 / libopenmpt 0.8.8 (current stable) 
Summary0001990: Pattern break in MOD/XM files is clamped without warning
Description

I was testing corner-cases in MOD/XM files, and I created an XM file that had a pattern break to line 135 or so, and I noticed that my player was jumping to the wrong row.

Basically, OpenMPT lets you write any value from 0x00 to 0xFF in a Dxx effect, but then it can only save values from 0x00 to 0x9F in the final file. While you are editing the file, it will use the original value without letting you know it goes over the limit, it will even jump to the correct row in the following pattern. When you save it, it doesn't warn you or anything because CSoundFile::ModSaveCommand() doesn't check bounds for CMD_PATTERNBREAK. It simply overflows, it doesn't max out at 0x9F.

For MOD this isn't a big deal because you can't have MOD patterns with more than 64 rows, but XM can have longer patterns, and it could happen that someone uses a pattern break with a parameter over 0x9F.

I would expect that the pattern editor doesn't let me input values higher than 0x9F, or that it warns me when it saves the file.

Steps To Reproduce
  1. Create a MOD/XM file.
  2. Add the following effects: D9F, DA0, DA1.
  3. Save the file and close it.
  4. Load the file. The effects become D9F, D00, D01.
TagsNo tags attached.
Attached Files
pattern_sizes.zip (595 bytes)
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Issue History

Date Modified Username Field Change
2026-10-11 19:52 SkyLyrac New Issue
2026-10-11 19:52 SkyLyrac File Added: pattern_sizes.zip
2026-10-11 19:54 SkyLyrac Description Updated