Module: sems
Branch: rco/offer_answer
Commit: c732cfe760645332480f20d6f87e91392006b8ac
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=c732cfe760645332480f20d6f87e91392006b8ac

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Apr 15 17:17:40 2011 +0200

avoid crashing

---

 core/AmRtpStream.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp
index 65ad350..a8c64e2 100644
--- a/core/AmRtpStream.cpp
+++ b/core/AmRtpStream.cpp
@@ -626,6 +626,12 @@ int AmRtpStream::init(AmPayloadProviderInterface* 
payload_provider,
 
   // TODO: take the first *supported* payload
   //       (align with the SDP answer algo)
+  if(local_media.payloads.empty()) {
+
+    ERROR("local_media.payloads.empty()\n");
+    return -1;
+  }
+
   payload = local_media.payloads[0].payload_type;
   last_payload = payload;
 

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to