diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-09-08 15:21:56 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-09-08 15:21:56 +0000 |
commit | e2d81373ceb10ec4307528c793a79058d2d33d93 (patch) | |
tree | 36039d63ef8caed4420abbe4c3eab60f222b83fc | |
parent | 03c39c1ff8bb8e932c75c52312a3d9d6ffbf67d5 (diff) |
Fixed assertion caused by too small output buffer size of stream, this happens when codec with very small bandwidth is used, e.g: MELP 2.4kbps, (thanks William Wong).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2265 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index f8f4c16e..6a99bbb5 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -1377,6 +1377,7 @@ static pj_status_t create_channel( pj_pool_t *pool, { pjmedia_channel *channel; pj_status_t status; + unsigned min_out_pkt_size; /* Allocate memory for channel descriptor */ @@ -1407,6 +1408,15 @@ static pj_status_t create_channel( pj_pool_t *pool, if (channel->out_pkt_size > PJMEDIA_MAX_MTU) channel->out_pkt_size = PJMEDIA_MAX_MTU; + /* It should big enough to hold (minimally) RTCP SR with an SDES. */ + min_out_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) + + sizeof(pjmedia_rtcp_common) + + (4 + stream->cname.slen) + + 32; + + if (channel->out_pkt_size < min_out_pkt_size) + channel->out_pkt_size = min_out_pkt_size; + channel->out_pkt = pj_pool_alloc(pool, channel->out_pkt_size); PJ_ASSERT_RETURN(channel->out_pkt != NULL, PJ_ENOMEM); |