summaryrefslogtreecommitdiff
path: root/dsp.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-08-19 18:52:56 +0000
committerMark Spencer <markster@digium.com>2004-08-19 18:52:56 +0000
commit3ca96a1317e7e1d74f81944b97bbd6fe78d470e6 (patch)
tree731d7778d6581ea05726f21209826ae0b37a99b3 /dsp.c
parent3bcff2d2f903a8aef888195d94ee837a8232cdce (diff)
Fix divide by zero (bugs #2268 and 2259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'dsp.c')
-rwxr-xr-xdsp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dsp.c b/dsp.c
index 5d61ff808..e637aa65b 100755
--- a/dsp.c
+++ b/dsp.c
@@ -1228,6 +1228,9 @@ static int __ast_dsp_silence(struct ast_dsp *dsp, short *s, int len, int *totals
int accum;
int x;
int res = 0;
+
+ if (!len)
+ return 0;
accum = 0;
for (x=0;x<len; x++)