summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-23 23:27:49 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-24 03:31:11 +0000
commit09f40e266b8e796db0137c5ef25ce1d3da2b4e31 (patch)
tree0ff00396ff16e042075f171e592a2bd0edb638da /apps
parent0c4ae417d596dc6385bf4a5e07567a360f4a4ccc (diff)
downloadrockbox-09f40e266b8e796db0137c5ef25ce1d3da2b4e31.tar.gz
rockbox-09f40e266b8e796db0137c5ef25ce1d3da2b4e31.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/talk.c3
1 files changed, 3 insertions, 0 deletions
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)
919#endif /* CONFIG_CODEC == SWCODEC */ 919#endif /* CONFIG_CODEC == SWCODEC */
920 mutex_init(&read_buffer_mutex); 920 mutex_init(&read_buffer_mutex);
921 } 921 }
922
923 talk_force_shutup(); /* In case we have something speaking! */
924
922 talk_initialized = true; 925 talk_initialized = true;
923 strlcpy((char *)last_lang, (char *)global_settings.lang_file, 926 strlcpy((char *)last_lang, (char *)global_settings.lang_file,
924 MAX_FILENAME); 927 MAX_FILENAME);