diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-02-21 09:00:36 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-02-21 09:00:36 +0000 |
commit | d277c485a04b43f04fa40dce59ae11b7cbf2fae4 (patch) | |
tree | b22f5430ba3e067afaf701b424a343e94555dcda | |
parent | 7d6f281850fadac4b6824e6785ecd90ab0d0b27e (diff) |
Ticket #487: Crash occured when stream port has no transmitter on call using ILBC with different ptime
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1809 74dad513-b988-da41-8d7b-12977e46ad98
-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); } |