summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-02-21 09:00:36 +0000
committerBenny Prijono <bennylp@teluu.com>2008-02-21 09:00:36 +0000
commitd277c485a04b43f04fa40dce59ae11b7cbf2fae4 (patch)
treeb22f5430ba3e067afaf701b424a343e94555dcda /pjmedia
parent7d6f281850fadac4b6824e6785ecd90ab0d0b27e (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
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia/stream.c9
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);
}