From: <sv...@op...> - 2024-12-18 22:04:06
|
Author: sagamusix Date: Wed Dec 18 23:03:55 2024 New Revision: 22570 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22570 Log: [Fix] Instrument Synth: Always avoid ending up in endless loops if a synth script is longer than 65535 lines, even if it was not sanitized (e.g. global scripts). Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentSynth.cpp Wed Dec 18 16:58:55 2024 (r22569) +++ trunk/OpenMPT/soundlib/InstrumentSynth.cpp Wed Dec 18 23:03:55 2024 (r22570) @@ -307,7 +307,7 @@ while(!m_ticksRemain) { m_currentRow = m_nextRow; - if(m_currentRow >= events.size()) + if(m_currentRow >= std::min(events.size(), static_cast<size_t>(STOP_ROW))) break; m_nextRow++; if(EvaluateEvent(events[m_currentRow], playState, channel, sndFile, states)) |