[asterisk-commits] file: trunk r403224 - in /trunk: ./ res/res_pjsip_sdp_rtp.c

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


Author: file
Date: Wed Nov 27 20:12:45 2013
New Revision: 403224

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403224
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
........

Merged revisions 403223 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_sdp_rtp.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Nov 27 20:12:45 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221,403223

Modified: trunk/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_sdp_rtp.c?view=diff&rev=403224&r1=403223&r2=403224
==============================================================================
--- trunk/res/res_pjsip_sdp_rtp.c (original)
+++ trunk/res/res_pjsip_sdp_rtp.c Wed Nov 27 20:12:45 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