From e1f08bb8aca5f5b2083794df6106ef181dcb3802 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 15 Apr 2022 18:32:36 -0700 Subject: [PATCH] Fix sequence buffer overrun --- src/audio/seqplayer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 410bb1f1..20e70aaa 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -2174,6 +2174,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { loBits = cmd & 7; switch (cmd & 0xf8) { case 0x80: + if (loBits >= LAYERS_MAX) break; if (seqChannel->layers[loBits] != NULL) { value = seqChannel->layers[loBits]->finished; } else { @@ -2218,6 +2219,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { break; #else case 0x00: // chan_testlayerfinished + if (loBits >= LAYERS_MAX) break; if (seqChannel->layers[loBits] != NULL) { value = seqChannel->layers[loBits]->finished; }