From adf4db9bc5bcdfb122227c96285b214d82fe0e51 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 23 Jun 2024 18:53:43 +0200 Subject: [PATCH] spd: Fix crash on cancelling with server audio The audio thread may call speak_queue_stop_or_pause after speaking_module is cleared by is_sb_speaking. --- src/server/output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/output.c b/src/server/output.c index 35423a2e..6a9543c9 100644 --- a/src/server/output.c +++ b/src/server/output.c @@ -952,6 +952,9 @@ static void output_queue_event(speak_queue_entry *entry) { char c = 0; int ret; + if (!speaking_module) + // We were cancelled + return; pthread_mutex_lock(&playback_events_mutex); playback_events = g_slist_append(playback_events, entry); pthread_mutex_unlock(&playback_events_mutex);