From: <sv...@op...> - 2024-03-23 13:19:59
|
Author: sagamusix Date: Sat Mar 23 14:19:49 2024 New Revision: 20423 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20423 Log: Merged revision(s) 20422 from branches/OpenMPT-1.29: [Fix] Avoid using infinity as map key when calculating pattern loop times to avoid UB (found with afl-fuzz + asan). ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.28/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.28/soundlib/Snd_fx.cpp Sat Mar 23 14:18:33 2024 (r20422) +++ branches/OpenMPT-1.28/soundlib/Snd_fx.cpp Sat Mar 23 14:19:49 2024 (r20423) @@ -1222,6 +1222,8 @@ || (command == CMD_MODCMDEX && param >= 0x61 && param <= 0x6F)) { const double start = memory.chnSettings[nChn].patLoop; + if(!std::isnormal(start)) + break; if(!startTimes[start]) startTimes[start] = 1; startTimes[start] = mpt::lcm(startTimes[start], 1 + (param & 0x0F)); } |