Ticket #487: ticket487.patch

File ticket487.patch, 700 bytes (added by nanang, 13 years ago)
  • pjmedia/src/pjmedia/stream.c

     
    480480 
    481481    /* Append new frame to the buffer */ 
    482482    if (frame->size) { 
    483         pj_memcpy(stream->enc_buf + stream->enc_buf_count, 
    484                   frame->buf, frame->size); 
     483        /* Handle case when there is no port transmitting to this port */ 
     484        if (frame->buf) { 
     485            pj_memcpy(stream->enc_buf + stream->enc_buf_count, 
     486                      frame->buf, frame->size); 
     487        } else { 
     488            pj_bzero(stream->enc_buf + stream->enc_buf_count, frame->size); 
     489        } 
    485490        stream->enc_buf_count += (frame->size >> 1); 
    486491    } 
    487492