From: Torrey Searle Date: Tue, 27 Jun 2017 15:46:43 +0000 (+0200) Subject: res/res_pjsip_t38: fix incorrect increment of media_count X-Git-Tag: 13.17.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f59d08924bc676970cabc6f3e291c7d1d2f2707;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c index 0ce6474e3a..4e76ac3c6d 100644 --- a/res/res_pjsip_t38.c +++ b/res/res_pjsip_t38.c @@ -278,7 +278,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;