From 906c5afd82dd289ba3af285acca5b9a8b1cf8e1c Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 10 Mar 2022 15:29:16 -0500 Subject: Ensure ev->next is NULL by default --- src/seq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/seq.c b/src/seq.c index 054b61c..c763db4 100644 --- a/src/seq.c +++ b/src/seq.c @@ -48,6 +48,8 @@ static int event_add(xas_seq *seq, xas_seq_event *ev) { seq->last = ev; } + ev->next = NULL; + return 0; } @@ -612,6 +614,10 @@ int xas_seq_play(xas_seq *seq, xas_audio_stream *sink) { goto error_event_trigger; } + if (ev->next == NULL) { + goto done; + } + ev = ev->next; } @@ -630,6 +636,7 @@ int xas_seq_play(xas_seq *seq, xas_audio_stream *sink) { frame++; } +done: xas_audio_stream_destroy(source); return frame * buffer_size; -- cgit v1.2.3