From: Mark Spencer Date: Thu, 19 Aug 2004 18:52:56 +0000 (+0000) Subject: Fix divide by zero (bugs #2268 and 2259) X-Git-Tag: 1.0.0~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ca96a1317e7e1d74f81944b97bbd6fe78d470e6;p=thirdparty%2Fasterisk.git Fix divide by zero (bugs #2268 and 2259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3626 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/dsp.c b/dsp.c index 5d61ff8081..e637aa65bd 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