From f611b5e854674fbd9aed5e9244f68cebe42bf8a4 Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Wed, 22 Apr 2020 13:24:58 +0900 Subject: [PATCH] Fix crash bug about tts text data Change-Id: I2653c67c44672b50261d7dcedbb84c16dd337c2a Signed-off-by: sungrae jo --- server/vcd_server.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/vcd_server.c b/server/vcd_server.c index 20934d8..b88f356 100755 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -2719,8 +2719,13 @@ int vcd_server_cancel_tts(int pid, int utt_id) if (0 != ret) { SLOG(LOG_WARN, TAG_VCD, "[Server WARN] No data in vcd tts text queue"); } else { - SLOG(LOG_INFO, TAG_VCD, "[Server] Clear tts text data, pid(%d), utt_id(%d), text(%s)", pid, utt_id, tts_text_data->text); - vcd_data_clear_tts_text_data(&tts_text_data); + if (tts_text_data) { + SLOG(LOG_INFO, TAG_VCD, "[Server] Clear tts text data, pid(%d), utt_id(%d), text(%s)", pid, utt_id, tts_text_data->text); + vcd_data_clear_tts_text_data(&tts_text_data); + tts_text_data = NULL; + } else { + SLOG(LOG_INFO, TAG_VCD, "[Server] Clear tts text data, pid(%d), utt_id(%d), text(nullptr)", pid, utt_id); + } } /* Request tts to engine */ -- 2.34.1