[asterisk-commits] file: branch 12 r403223 - /branches/12/res/res_pjsip_sdp_rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 27 20:12:06 CST 2013


Author: file
Date: Wed Nov 27 20:12:04 2013
New Revision: 403223

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403223
Log:
res_pjsip_sdp_rtp: Don't produce an invalid media stream with no formats.

Depending on configuration it was possible for a media stream to be
created without any media formats. The produced SDP would fail internal
validation and cause a crash.

The code will now no longer add media streams with no formats to the SDP,
allowing it to pass validation and work.

(closes issue ASTERISK-22858)
Reported by: Anthony Messina

Modified:
    branches/12/res/res_pjsip_sdp_rtp.c

Modified: branches/12/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_sdp_rtp.c?view=diff&rev=403223&r1=403222&r2=403223
==============================================================================
--- branches/12/res/res_pjsip_sdp_rtp.c (original)
+++ branches/12/res/res_pjsip_sdp_rtp.c Wed Nov 27 20:12:04 2013
@@ -983,6 +983,11 @@
 		}
 	}
 
+	/* If no formats were actually added to the media stream don't add it to the SDP */
+	if (!media->desc.fmt_count) {
+		return 1;
+	}
+
 	/* If ptime is set add it as an attribute */
 	if (min_packet_size) {
 		snprintf(tmp, sizeof(tmp), "%d", min_packet_size);




More information about the asterisk-commits mailing list