FS-8713 #resolve avoid read exceeding buffer

This commit is contained in:
Seven Du 2016-01-07 14:11:48 +08:00
parent 2a1b8bd4e6
commit 1746d2ebc0
2 changed files with 3 additions and 1 deletions

View File

@ -1088,6 +1088,8 @@ SWITCH_DECLARE(switch_status_t) switch_jb_put_packet(switch_jb_t *jb, switch_rtp
uint32_t i;
uint16_t want = ntohs(jb->next_seq), got = ntohs(packet->header.seq);
switch_assert(len <= SWITCH_RTP_MAX_BUF_LEN);
switch_mutex_lock(jb->mutex);
if (!want) want = got;

View File

@ -5132,7 +5132,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
block = 0;
}
*bytes = sizeof(rtp_msg_t);
*bytes = SWITCH_RTP_MAX_BUF_LEN;
sync = 0;
rtp_session->has_rtp = 0;