From: <sv...@op...> - 2024-11-27 12:48:02
|
Author: manx Date: Wed Nov 27 13:47:50 2024 New Revision: 22322 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22322 Log: Merged revision(s) 22320 from trunk/OpenMPT: [Ref] Use mpt::align_down. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_mod.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_mod.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_mod.cpp Wed Nov 27 13:46:25 2024 (r22321) +++ branches/OpenMPT-1.31/soundlib/Load_mod.cpp Wed Nov 27 13:47:50 2024 (r22322) @@ -620,7 +620,7 @@ // 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) { |