diff options
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index a7690c56..f326961a 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -480,8 +480,13 @@ static void rebuffer(pjmedia_stream *stream, /* Append new frame to the buffer */ if (frame->size) { - pj_memcpy(stream->enc_buf + stream->enc_buf_count, - frame->buf, frame->size); + /* Handle case when there is no port transmitting to this port */ + if (frame->buf) { + pj_memcpy(stream->enc_buf + stream->enc_buf_count, + frame->buf, frame->size); + } else { + pj_bzero(stream->enc_buf + stream->enc_buf_count, frame->size); + } stream->enc_buf_count += (frame->size >> 1); } |