[Asterisk-cvs] asterisk/channels chan_iax2.c,1.227,1.228
jim at lists.digium.com
jim at lists.digium.com
Thu Dec 23 02:08:36 CST 2004
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv29736/channels
Modified Files:
chan_iax2.c
Log Message:
Fix Divide by zero possibility (ouch!)
Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -d -r1.227 -r1.228
--- chan_iax2.c 23 Dec 2004 01:42:14 -0000 1.227
+++ chan_iax2.c 23 Dec 2004 07:04:16 -0000 1.228
@@ -2868,9 +2868,12 @@
* next multiple of frame size (so our
* silent periods are multiples of
* frame size too) */
- int diff = ms % (f->samples / 8);
- if(diff)
- ms += f->samples/8 - diff;
+ if (f->samples / 8) /* check to make sure we dont core dump */
+ {
+ int diff = ms % (f->samples / 8);
+ if (diff)
+ ms += f->samples/8 - diff;
+ }
p->nextpred = ms;
p->notsilenttx = 1;
More information about the svn-commits
mailing list