Commit 391af1dd authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed issues reported on linphone mailing list

parent 49fdc102
......@@ -206,10 +206,9 @@ bool_t rtcp_is_BYE(const mblk_t *m){
bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc){
rtcp_bye_t *bye=(rtcp_bye_t*)m->b_rptr;
int rc=rtcp_common_header_get_rc(&bye->ch);
int len=rtcp_common_header_get_length(&bye->ch);
if (idx<rc){
if ((uint8_t*)&bye->ssrc[idx]<=(m->b_rptr
+sizeof(rtcp_common_header_t)+len-4)) {
+ rtcp_get_size(m)-4)) {
*ssrc=ntohl(bye->ssrc[idx]);
return TRUE;
}else{
......
......@@ -2236,8 +2236,10 @@ int meta_rtp_transport_recvfrom(RtpTransport *t, mblk_t *msg, int flags, struct
ret=m->endpoint->t_recvfrom(m->endpoint,msg,flags,from,fromlen);
if (ret > 0) {
/*store recv addr for use by modifiers*/
memcpy(&msg->net_addr,from,*fromlen);
msg->net_addrlen = *fromlen;
if (from && fromlen) {
memcpy(&msg->net_addr,from,*fromlen);
msg->net_addrlen = *fromlen;
}
}
}else{
ret=rtp_session_recvfrom(t->session,m->is_rtp,msg,flags,from,fromlen);
......
......@@ -1363,8 +1363,10 @@ int rtp_session_rtp_recv_abstract(ortp_socket_t socket, mblk_t *msg, int flags,
#endif
}
/*store recv addr for use by modifiers*/
memcpy(&msg->net_addr,from,*fromlen);
msg->net_addrlen = *fromlen;
if (from && fromlen) {
memcpy(&msg->net_addr,from,*fromlen);
msg->net_addrlen = *fromlen;
}
}
return ret;
}
......
......@@ -40,8 +40,10 @@ void mblk_init(mblk_t *mp)
void mblk_meta_copy(const mblk_t *source, mblk_t *dest) {
dest->reserved1 = source->reserved1;
dest->reserved2 = source->reserved2;
memcpy(&dest->net_addr,&source->net_addr,source->net_addrlen);
dest->net_addrlen = source->net_addrlen;
if (&source->net_addr) {
memcpy(&dest->net_addr,&source->net_addr,source->net_addrlen);
dest->net_addrlen = source->net_addrlen;
}
#if defined(ORTP_TIMESTAMP)
dest->timestamp = source->timestamp;
#endif
......
......@@ -325,7 +325,7 @@ int rtp_session_read_telephone_event(RtpSession *session,
telephone_event_t *tev;
rtp_header_t *hdr=(rtp_header_t*)packet->b_rptr;
unsigned char *payload;
if (rtp_profile_is_telephone_event(session->rcv.profile, hdr->paytype)) return 0; /* this is not tel ev.*/
if (!rtp_profile_is_telephone_event(session->rcv.profile, hdr->paytype)) return 0; /* this is not tel ev.*/
datasize=rtp_get_payload(packet,&payload);
tev=*tab=(telephone_event_t*)payload;
/* convert from network to host order what should be */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment