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

Don't load STM samples with volume=0, fix sample offset calculation. #13

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

AliceLR
Copy link
Collaborator

@AliceLR AliceLR commented Oct 19, 2020

This fixes various edge-case bugs that affect a handful of .STM files. This is the same patch I posted before but, aside from minor details like setting seekpos=0, I'm fairly confident this patch is correct/ready for PR.

  • STM samples with zero volume are now treated as having zero length and are now ignored entirely.
  • STM sample offsets are now calculated with [reserved byte]<<4. This replaces the MikMod_ISA variable that was being used to work around some instances of the zero volume samples bug.
  • STM samples that break file bounds will be truncated or result in the file being rejected altogether.

Fixes #6.

* STM samples with zero volume are now treated as having zero length
  and are now ignored entirely.
* STM sample offsets are now calculated with [reserved byte]<<4. This
  replaces the MikMod_ISA variable that was being used to work around
  some instances of the zero volume samples bug.
* STM samples that break file bounds will be truncated or result in
  the file being rejected altogether.
@sezero sezero merged commit 3c147e5 into sezero:master Oct 22, 2020
@AliceLR AliceLR deleted the fix-stm-volume-zero-samples branch October 22, 2020 03:16
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.

STM loader should ignore volume=0 samples for certain .STMs.
2 participants