Fix Divide by zero possibility (ouch!)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Jim Dixon 21 years ago
parent a2775a6109
commit 8e1a2d57a6

@ -2868,9 +2868,12 @@ static unsigned int calc_timestamp(struct chan_iax2_pvt *p, unsigned int ts, str
* next multiple of frame size (so our
* silent periods are multiples of
* frame size too) */
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;

Loading…
Cancel
Save