mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
fix div by zero (bug #3467)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2893,10 +2893,13 @@ 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) */
|
||||
int diff = ms % (f->samples / 8);
|
||||
if(diff)
|
||||
ms += f->samples/8 - diff;
|
||||
|
||||
int adj = f->samples / 8;
|
||||
if (adj) {
|
||||
int diff = ms % adj;
|
||||
if(diff)
|
||||
ms += adj - diff;
|
||||
}
|
||||
|
||||
p->nextpred = ms;
|
||||
p->notsilenttx = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user