From e110106a7cac431b05fdf72facef1abbe62e93b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Heusipp?= Date: Wed, 27 Nov 2024 12:47:50 +0000 Subject: [PATCH] Merged revision(s) 22320 from trunk/OpenMPT: [Ref] Use mpt::align_down. ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@22322 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- soundlib/Load_mod.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soundlib/Load_mod.cpp b/soundlib/Load_mod.cpp index 61c2eeaa9bb..591acef0631 100644 --- a/soundlib/Load_mod.cpp +++ b/soundlib/Load_mod.cpp @@ -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) {