From ff4fe5ed2b6d889ceab58c86a23ffa5a6d52ac12 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 26 Sep 2008 18:14:37 +0000 Subject: [PATCH] extra protection git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9663 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_cepstral/mod_cepstral.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c index fd036aaef4..5d914a04f1 100644 --- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.c +++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.c @@ -150,7 +150,7 @@ static switch_status_t cepstral_speech_open(switch_speech_handle_t *sh, const ch voice_name = NULL; } - if (!voice_name) { + if (switch_strlen_zero(voice_name)) { /* Find the first voice on the system */ if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n"); @@ -219,6 +219,9 @@ static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char cepstral->tts_stream = NULL; + if (switch_strlen_zero(text)) { + return SWITCH_STATUS_FALSE; + } if (!strncasecmp(text, fp, len)) { text += len; if (switch_strlen_zero(text)) {