From b9e359a6be75c235ac4c17b48aba496c1a177ff4 Mon Sep 17 00:00:00 2001 From: markster Date: Thu, 19 Aug 2004 18:52:56 +0000 Subject: Fix divide by zero (bugs #2268 and 2259) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3626 f38db490-d61c-443f-a65b-d21fe96a405b --- dsp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dsp.c') 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