Skip to content

Commit 008e3e1

Browse files
committed
[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).
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22570 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent be039bc commit 008e3e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

soundlib/InstrumentSynth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void InstrumentSynth::States::State::NextTick(const Events &events, PlayState &p
307307
while(!m_ticksRemain)
308308
{
309309
m_currentRow = m_nextRow;
310-
if(m_currentRow >= events.size())
310+
if(m_currentRow >= std::min(events.size(), static_cast<size_t>(STOP_ROW)))
311311
break;
312312
m_nextRow++;
313313
if(EvaluateEvent(events[m_currentRow], playState, channel, sndFile, states))

0 commit comments

Comments
 (0)