Changeset 5671


Ignore:
Timestamp:
10/06/17 01:54:37 (16 months ago)
Author:
riza
Message:

Re #2045(misc): To prevent assertion, don't copy rem_rtcp on pjmedia_stream_create()/pjmedia_vid_stream_create() if address is not set.
Thanks to Lauri Vanksa for the Report.

Location:
pjproject/trunk/pjmedia/src/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r5667 r5671  
    23492349 
    23502350    stream->out_rtcp_pkt = pj_pool_alloc(pool, stream->out_rtcp_pkt_size); 
     2351    pj_bzero(&att_param, sizeof(att_param)); 
    23512352    att_param.stream = stream; 
    23522353    att_param.media_type = PJMEDIA_TYPE_AUDIO; 
    23532354    att_param.user_data = stream; 
    23542355    pj_sockaddr_cp(&att_param.rem_addr, &info->rem_addr); 
    2355     pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_rtcp); 
     2356    if (pj_sockaddr_has_addr(&info->rem_rtcp.addr)) 
     2357        pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_rtcp); 
    23562358    att_param.addr_len = pj_sockaddr_get_len(&info->rem_addr); 
    23572359    att_param.rtp_cb = &on_rx_rtp; 
  • pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c

    r5534 r5671  
    16661666 
    16671667    stream->out_rtcp_pkt = pj_pool_alloc(pool, stream->out_rtcp_pkt_size); 
     1668    pj_bzero(&att_param, sizeof(att_param)); 
    16681669    att_param.stream = stream; 
    16691670    att_param.media_type = PJMEDIA_TYPE_VIDEO; 
    16701671    att_param.user_data = stream; 
    16711672    pj_sockaddr_cp(&att_param.rem_addr, &info->rem_addr); 
    1672     pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_rtcp); 
     1673    if (pj_sockaddr_has_addr(&info->rem_rtcp.addr)) 
     1674        pj_sockaddr_cp(&att_param.rem_rtcp, &info->rem_rtcp);     
    16731675    att_param.addr_len = pj_sockaddr_get_len(&info->rem_addr); 
    16741676    att_param.rtp_cb = &on_rx_rtp; 
Note: See TracChangeset for help on using the changeset viewer.