libxmp / libxmp

Libxmp is a library that renders module files to PCM data.
305 stars 70 forks source link

ProPacker 1.0 modules are sometimes misidentified as Module Protector. #278

Closed AliceLR closed 3 years ago

AliceLR commented 3 years ago

Splitting this from the comments thread from #266—two of the example ProPacker 1.0 modules provided are incorrectly identified as Module Protector modules. When the Module Protector (no ID) loader is commented out, these load as expected. The Module Protector test functions may need better validation or this loader may have to be moved after the ProPacker loaders.

ProPacker 1.0 problem examples.zip

AliceLR commented 3 years ago

Further examination of this suggests the only convincing way to fix this is to move the Module Protector noID test after the ProPacker 1.0 test.

The Module Protector format has a size 378 header with a table of 128 pattern numbers. Everything immediately after this header is considered pattern data. This pattern data has standard Protracker events.

ProPacker 1.0 files have a size 762 header containing a table of 512 tracks. This table is usually sparse and, because Protracker events don't have a lot of invalid states, the Module Protector noID loader can easily misidentify it as pattern data. Adding e.g. a sample number sanity check to the Module Protector noID test was not enough to get it to filter out these files.