]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix divide by zero (bugs #2268 and 2259)
authorMark Spencer <markster@digium.com>
Thu, 19 Aug 2004 18:52:56 +0000 (18:52 +0000)
committerMark Spencer <markster@digium.com>
Thu, 19 Aug 2004 18:52:56 +0000 (18:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3626 65c4cc65-6c06-0410-ace0-fbb531ad65f3

dsp.c

diff --git a/dsp.c b/dsp.c
index 5d61ff8081cc08c6f148fb18d1b92df6d89d88e3..e637aa65bd2a7632cc74159320cf0b5be2323b08 100755 (executable)
--- 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++)