]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7431 #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 14 Apr 2015 20:46:04 +0000 (15:46 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 14 Apr 2015 20:46:04 +0000 (15:46 -0500)
src/mod/formats/mod_tone_stream/mod_tone_stream.c

index ffc970adeecea1bdaf2c552ea6185cfb0a011581..90d1fec0cf1f1931af56cdc844b7928b15355551 100644 (file)
@@ -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 <msec>[,<silence_factor>]\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 {