Changeset 5901 for pjproject


Ignore:
Timestamp:
Nov 2, 2018 6:45:58 AM (6 years ago)
Author:
nanang
Message:

Misc (re #2147): Assertion in pj_sockaddr_cp() when pjmedia_transport_attach() is called with rem_rtcp zero initialized (thanks Lauri Vänskä for the report).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/transport.h

    r5853 r5901  
    782782        param.user_data = user_data; 
    783783        pj_sockaddr_cp(&param.rem_addr, rem_addr); 
    784         pj_sockaddr_cp(&param.rem_rtcp, rem_rtcp); 
     784        if (rem_rtcp && pj_sockaddr_has_addr(rem_rtcp)) { 
     785            pj_sockaddr_cp(&param.rem_rtcp, rem_rtcp); 
     786        } else { 
     787            /* Copy RTCP address from the RTP address, with port + 1 */ 
     788            pj_memcpy(&param.rem_rtcp, rem_addr, addr_len); 
     789            pj_sockaddr_set_port(&param.rem_rtcp, 
     790                                 pj_sockaddr_get_port(rem_addr) + 1); 
     791        } 
    785792        param.addr_len = addr_len; 
    786793        param.rtp_cb = rtp_cb; 
Note: See TracChangeset for help on using the changeset viewer.