Merged revisions 221777 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

................
  r221777 | tilghman | 2009-10-01 18:59:15 -0500 (Thu, 01 Oct 2009) | 9 lines
  
  Merged revisions 221776 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r221776 | tilghman | 2009-10-01 18:53:12 -0500 (Thu, 01 Oct 2009) | 2 lines
    
    Fix a bunch of off-by-one errors
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@221779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-10-02 00:06:46 +00:00
parent c8553b7634
commit e669471e75
3 changed files with 20 additions and 20 deletions

View File

@@ -2239,7 +2239,7 @@ int ast_rtp_make_compatible(struct ast_channel *dest, struct ast_channel *src, i
*/
void ast_rtp_set_m_type(struct ast_rtp* rtp, int pt)
{
if (pt < 0 || pt > MAX_RTP_PT || static_RTP_PT[pt].code == 0)
if (pt < 0 || pt >= MAX_RTP_PT || static_RTP_PT[pt].code == 0)
return; /* bogus payload type */
rtp_bridge_lock(rtp);
@@ -2251,7 +2251,7 @@ void ast_rtp_set_m_type(struct ast_rtp* rtp, int pt)
an unknown media type */
void ast_rtp_unset_m_type(struct ast_rtp* rtp, int pt)
{
if (pt < 0 || pt > MAX_RTP_PT)
if (pt < 0 || pt >= MAX_RTP_PT)
return; /* bogus payload type */
rtp_bridge_lock(rtp);
@@ -2271,7 +2271,7 @@ int ast_rtp_set_rtpmap_type(struct ast_rtp *rtp, int pt,
unsigned int i;
int found = 0;
if (pt < 0 || pt > MAX_RTP_PT)
if (pt < 0 || pt >= MAX_RTP_PT)
return -1; /* bogus payload type */
rtp_bridge_lock(rtp);
@@ -2321,7 +2321,7 @@ struct rtpPayloadType ast_rtp_lookup_pt(struct ast_rtp* rtp, int pt)
result.isAstFormat = result.code = 0;
if (pt < 0 || pt > MAX_RTP_PT)
if (pt < 0 || pt >= MAX_RTP_PT)
return result; /* bogus payload type */
/* Start with negotiated codecs */
@@ -3745,7 +3745,7 @@ struct ast_codec_pref *ast_rtp_codec_getpref(struct ast_rtp *rtp)
int ast_rtp_codec_getformat(int pt)
{
if (pt < 0 || pt > MAX_RTP_PT)
if (pt < 0 || pt >= MAX_RTP_PT)
return 0; /* bogus payload type */
if (static_RTP_PT[pt].isAstFormat)