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/trunk@221777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-10-01 23:59:15 +00:00
parent dd0c76a9d3
commit 8c7b3cf738
3 changed files with 18 additions and 18 deletions

View File

@@ -499,7 +499,7 @@ void ast_rtp_codecs_payloads_copy(struct ast_rtp_codecs *src, struct ast_rtp_cod
void ast_rtp_codecs_payloads_set_m_type(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload)
{
if (payload < 0 || payload > AST_RTP_MAX_PT || !static_RTP_PT[payload].code) {
if (payload < 0 || payload >= AST_RTP_MAX_PT || !static_RTP_PT[payload].code) {
return;
}
@@ -521,7 +521,7 @@ int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs,
unsigned int i;
int found = 0;
if (pt < 0 || pt > AST_RTP_MAX_PT)
if (pt < 0 || pt >= AST_RTP_MAX_PT)
return -1; /* bogus payload type */
for (i = 0; i < ARRAY_LEN(ast_rtp_mime_types); ++i) {
@@ -569,7 +569,7 @@ int ast_rtp_codecs_payloads_set_rtpmap_type(struct ast_rtp_codecs *codecs, struc
void ast_rtp_codecs_payloads_unset(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload)
{
if (payload < 0 || payload > AST_RTP_MAX_PT) {
if (payload < 0 || payload >= AST_RTP_MAX_PT) {
return;
}
@@ -587,7 +587,7 @@ struct ast_rtp_payload_type ast_rtp_codecs_payload_lookup(struct ast_rtp_codecs
{
struct ast_rtp_payload_type result = { .asterisk_format = 0, };
if (payload < 0 || payload > AST_RTP_MAX_PT) {
if (payload < 0 || payload >= AST_RTP_MAX_PT) {
return result;
}