Skip to content

Commit

Permalink
Merged revision(s) 22320 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Ref] Use mpt::align_down.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@22322 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Nov 27, 2024
1 parent 5fc2639 commit e110106
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion soundlib/Load_mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static PATTERNINDEX GetNumPatterns(FileReader &file, ModSequence &Order, ORDERIN
// There are some WOW files with an extra byte at the end, and also a MOD file (idntmind.mod, MD5 a3af5c3e1af269e32dfb6677c41c8453, SHA1 4884717c298575f9884b2211c762bb1725f73743)
// where only the "official" patterns should be counted but the file also has an extra byte at the end.
// Since MOD files can technically not have an odd file size, we just always round the actual file size down.
const auto fileSize = file.GetLength() & ~FileReader::pos_type{1};
const auto fileSize = mpt::align_down(file.GetLength(), FileReader::pos_type{2});

if(wowSampleLen && (wowSampleLen + patternStartOffset) + numPatterns * 8 * 256 == fileSize)
{
Expand Down

0 comments on commit e110106

Please sign in to comment.