Skip to content

Commit accfe2b

Browse files
committed
fix a potential freeze when pasting invalid snapshot data
1 parent 1eac4cb commit accfe2b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Snapshots/SnapshotClass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ Snapshot::Snapshot(const char* chunk)
746746
TrackSnapshot* ts = NULL;
747747
m_cName = NULL;
748748
m_cNotes = NULL;
749+
m_iSlot = 0;
749750

750751
int auxEnvsOccurence = -1;
751752

@@ -822,7 +823,6 @@ Snapshot::Snapshot(const char* chunk)
822823

823824
ts->m_sends.m_sends.Add(new TrackSend(line, AUXVOL.Get(), AUXPAN.Get(), AUXMUTE.Get()));
824825
}
825-
826826
else if (strcmp("HWOUT", lp.gettoken_str(0)) == 0)
827827
ts->m_sends.m_hwSends.Add(new WDL_FastString(line));
828828
else if (strcmp("FX", lp.gettoken_str(0)) == 0) // "One liner"
@@ -869,7 +869,9 @@ Snapshot::Snapshot(const char* chunk)
869869
else if (ts->ProcessEnv(chunk, line, 4096, &pos, "<MUTEENV", &ts->m_sMuteEnv)) {}
870870
}
871871
}
872-
RegisterSnapshotSlot(m_iSlot);
872+
873+
if (m_iSlot > 0)
874+
RegisterSnapshotSlot(m_iSlot);
873875
}
874876

875877
Snapshot::~Snapshot()

0 commit comments

Comments
 (0)