Bug 792811 - Check creation of WebRTC transportflows r=jesup
authorEKR <ekr@rtfm.com>
Tue, 09 Oct 2012 12:29:01 -0700
changeset 110200 eeba6e1170813924da9464290b2f3900262e0542
parent 110199 9990a1074771f94c9f8a31e890022725f23ae002
child 110201 9f6acef4c469c2b7f6988e4283a56941fdda590f
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjesup
bugs792811
milestone19.0a1
Bug 792811 - Check creation of WebRTC transportflows r=jesup
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -1222,19 +1222,27 @@ int vcmRxStartICE(cc_mcapid_t mcap_id,
     // This should never happen
     PR_ASSERT(PR_FALSE);
     return VCM_ERROR;
   }
   // Create the transport flows
   mozilla::RefPtr<TransportFlow> rtp_flow =
       vcmCreateTransportFlow(pc->impl(), level, false,
                              fingerprint_alg, fingerprint);
+  if (!rtp_flow) {
+      CSFLogError( logTag, "Could not create RTP flow");
+      return VCM_ERROR;
+  }
   mozilla::RefPtr<TransportFlow> rtcp_flow =
       vcmCreateTransportFlow(pc->impl(), level, true,
                              fingerprint_alg, fingerprint);
+  if (!rtcp_flow) {
+      CSFLogError( logTag, "Could not create RTCP flow");
+      return VCM_ERROR;
+  }
 
   if (CC_IS_AUDIO(mcap_id)) {
     std::vector<mozilla::AudioCodecConfig *> configs;
     // Instantiate an appropriate conduit
     mozilla::RefPtr<mozilla::AudioSessionConduit> conduit =
                     mozilla::AudioSessionConduit::Create();
     if(!conduit)
       return VCM_ERROR;
@@ -1765,20 +1773,28 @@ int vcmTxStartICE(cc_mcapid_t mcap_id,
   if (!pc) {
     return VCM_ERROR;
   }
   nsRefPtr<sipcc::LocalSourceStreamInfo> stream = pc->impl()->GetLocalStream(pc_stream_id);
   
   // Create the transport flows
   mozilla::RefPtr<TransportFlow> rtp_flow = 
       vcmCreateTransportFlow(pc->impl(), level, false,
-                             fingerprint_alg, fingerprint);                             
+                             fingerprint_alg, fingerprint);
+  if (!rtp_flow) {
+      CSFLogError( logTag, "Could not create RTP flow");
+      return VCM_ERROR;
+  }
   mozilla::RefPtr<TransportFlow> rtcp_flow = 
       vcmCreateTransportFlow(pc->impl(), level, true,
                              fingerprint_alg, fingerprint);
+  if (!rtcp_flow) {
+      CSFLogError( logTag, "Could not create RTCP flow");
+      return VCM_ERROR;
+  }
 
   if (CC_IS_AUDIO(mcap_id)) {
     // Find the appropriate media conduit config
     mozilla::AudioCodecConfig *config_raw;
     int ret = vcmPayloadType2AudioCodec(payload, &config_raw);
     if (ret) {
       return VCM_ERROR;
     }