Skip to content

Commit 71cf448

Browse files
committed
Crash-fix for moving sample loops while tuning-tone is on
1 parent a9f336b commit 71cf448

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pt2_replayer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ double ciaBpm2Hz(int32_t bpm)
5050

5151
void updatePaulaLoops(void) // used after manipulating sample loop points while Paula is live
5252
{
53+
moduleSample_t *s = &song->samples[editor.currSample];
54+
5355
const bool audioWasntLocked = !audio.locked;
5456
if (audioWasntLocked)
5557
lockAudio();
5658

57-
moduleSample_t *s = &song->samples[editor.currSample];
58-
5959
moduleChannel_t *ch = song->channels;
6060
for (uint32_t i = 0; i < PAULA_VOICES; i++, ch++)
6161
{
62-
if (ch->n_samplenum == editor.currSample) // selected sample matches channel's sample?
62+
if (ch->n_samplenum == editor.currSample && ch->n_start != NULL)
6363
{
6464
const uint32_t voiceAddr = 0xDFF0A0 + (i * 16);
6565

0 commit comments

Comments
 (0)