From 09f40e266b8e796db0137c5ef25ce1d3da2b4e31 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 23 Jul 2020 23:27:49 -0400 Subject: talk: Force-shutdown the voice system before loading a new voice Otherwise we might actually be talking when we try to switch, or otherwise trash the state of the running talk thread, leading to memory corruption or an outright crash (This fixes a panic observed on the xDuoo X3) Change-Id: I78e4232085c5c160c9ee4f18167dad8dad2b9287 --- apps/talk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/talk.c b/apps/talk.c index 3c532d964c..72b9a2eb30 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -919,6 +919,9 @@ void talk_init(void) #endif /* CONFIG_CODEC == SWCODEC */ mutex_init(&read_buffer_mutex); } + + talk_force_shutup(); /* In case we have something speaking! */ + talk_initialized = true; strlcpy((char *)last_lang, (char *)global_settings.lang_file, MAX_FILENAME); -- cgit v1.2.3