summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorTorrey Searle <torrey@voxbone.com>2017-06-27 17:46:43 +0200
committerSean Bright <sean.bright@gmail.com>2017-06-27 11:46:23 -0500
commita48d3e4d31c8060856d785fca00c5213d5e012bc (patch)
tree88bc805cd05b265e0bc02590dc453876daf43078 /res/res_pjsip_t38.c
parentd59b0efabd811370540bbb70ee7073cb79d088a7 (diff)
res/res_pjsip_t38: fix incorrect increment of media_count
The T38 sdp callback incorrectly has a side effect of incrementing the media_count. This can lead to core dumps. Change-Id: I7bb2f4987de4046ec52cfc34e5ea0662dae32af8
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index bb1641a44..6019412b0 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -276,7 +276,7 @@ static int t38_reinvite_sdp_cb(struct ast_sip_session *session, pjmedia_sdp_sess
/* Move the image media stream to the front and have it as the only stream, pjmedia will fill in
* dummy streams for the rest
*/
- for (stream = 0; stream < sdp->media_count++; ++stream) {
+ for (stream = 0; stream < sdp->media_count; ++stream) {
if (!pj_strcmp2(&sdp->media[stream]->desc.media, "image")) {
sdp->media[0] = sdp->media[stream];
sdp->media_count = 1;