From 464d8ab91086715a2ec7eb1fb9a2d2cb53377eb7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Apr 2015 15:46:04 -0500 Subject: [PATCH] FS-7431 #resolve --- src/mod/formats/mod_tone_stream/mod_tone_stream.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/formats/mod_tone_stream/mod_tone_stream.c b/src/mod/formats/mod_tone_stream/mod_tone_stream.c index ffc970adee..90d1fec0cf 100644 --- a/src/mod/formats/mod_tone_stream/mod_tone_stream.c +++ b/src/mod/formats/mod_tone_stream/mod_tone_stream.c @@ -48,10 +48,15 @@ static switch_status_t silence_stream_file_open(switch_file_handle_t *handle, co int ms; char *p; - sh = switch_core_alloc(handle->memory_pool, sizeof(*sh)); - ms = atoi(path); + if (ms == 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid Input [%s] Expect [,]\n", path); + return SWITCH_STATUS_FALSE; + } + + sh = switch_core_alloc(handle->memory_pool, sizeof(*sh)); + if (ms > 0) { sh->samples = (handle->samplerate / 1000) * ms; } else { -- 2.47.2