From 6b9024246f9b72847c69a009429269fecde0746c Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 16 May 2014 14:54:54 +0000 Subject: [PATCH] CID:1214189 Division or modulo by float zero --- libs/libteletone/src/libteletone_detect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/libteletone/src/libteletone_detect.c b/libs/libteletone/src/libteletone_detect.c index b89ea11645..f25fea73ff 100644 --- a/libs/libteletone/src/libteletone_detect.c +++ b/libs/libteletone/src/libteletone_detect.c @@ -141,6 +141,10 @@ TELETONE_API(void) teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf int i; float theta; + if (!sample_rate) { + sample_rate = 8000; + } + dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0; for (i = 0; i < GRID_FACTOR; i++) {