From: <sv...@op...> - 2024-11-27 12:46:37
|
Author: manx Date: Wed Nov 27 13:46:25 2024 New Revision: 22321 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22321 Log: Merged revision(s) 22318 from trunk/OpenMPT: [Ref] Enforce the bit maks for ANDing the file size to be of type pos_type. ........ 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:41:35 2024 (r22320) +++ branches/OpenMPT-1.31/soundlib/Load_mod.cpp Wed Nov 27 13:46:25 2024 (r22321) @@ -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() & ~1; + const auto fileSize = file.GetLength() & ~FileReader::pos_type{1}; if(wowSampleLen && (wowSampleLen + patternStartOffset) + numPatterns * 8 * 256 == fileSize) { |