Remove the potential for a division by zero error.

(Closes issue #13810)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-11-03 21:48:21 +00:00
parent 18df35a2c1
commit 9f7707dae8

View File

@@ -1919,7 +1919,7 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
}
/* Select a random port number in the range of possible RTP */
x = (ast_random() % (rtpend-rtpstart)) + rtpstart;
x = (rtpend == rtpstart) ? rtpstart : (ast_random() % (rtpend - rtpstart)) + rtpstart;
x = x & ~1;
/* Save it for future references. */
startplace = x;