mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
Fix Divide by zero possibility (ouch!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user