Bug 1066935 - Part 2: Fix some -Wmaybe-uninitialized warnings in webrtc/signaling. r=jesup
authorChris Peterson <cpeterson@mozilla.com>
Sat, 13 Sep 2014 13:07:26 -0700
changeset 205215 df5e004949644858d92ff517f1da698f18509645
parent 205214 51cb121dd56e2f9fd513baa00397fec6b4ea7ca3
child 205216 55948a19e455f8e5009c146360e7896cbdaf758c
push id49112
push usercpeterson@mozilla.com
push dateSun, 14 Sep 2014 06:18:45 +0000
treeherdermozilla-inbound@df5e00494964 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1066935
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1066935 - Part 2: Fix some -Wmaybe-uninitialized warnings in webrtc/signaling. r=jesup
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -470,17 +470,17 @@ WebrtcGmpVideoEncoder::Encoded(GMPVideoE
           buffer += 3;
           break;
         case GMP_BufferLength32:
           // presumes we can do unaligned loads
           size = *(reinterpret_cast<uint32_t*>(buffer));
           buffer += 4;
           break;
         default:
-          break; // already handled above
+          MOZ_CRASH("GMP_BufferType already handled in switch above");
       }
       if (buffer+size > end) {
         // XXX see above - should we kill the plugin for returning extra bytes?  Probably
         LOG(PR_LOG_ERROR,
             ("GMP plugin returned badly formatted encoded data: end is %td bytes past buffer end",
              buffer+size - end));
         return;
       }
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -2074,16 +2074,17 @@ int vcmTxStartICE(cc_mcapid_t mcap_id,
     mediaType = "audio";
     err = vcmTxCreateAudioConduit(level, payload, pc, attrs, conduit);
     is_video = false;
   } else if (CC_IS_VIDEO(mcap_id)) {
     mediaType = "video";
     err = vcmTxCreateVideoConduit(level, payload, pc, attrs, conduit);
     is_video = true;
   } else {
+    mediaType = "unrecognized";
     CSFLogError(logTag, "%s: mcap_id unrecognized", __FUNCTION__);
   }
   if (err) {
     CSFLogError(logTag, "%s: failed to create %s conduit", __FUNCTION__, mediaType);
     return err;
   }
 
   pc.impl()->media()->AddConduit(level, false, conduit);
@@ -2847,9 +2848,8 @@ short vcmGetVideoMaxMbps(uint16_t codec,
   return ret;
 }
 
 short vcmGetVideoPreferredCodec(int32_t *preferred_codec) {
   return vcmGetVideoPref((uint16_t)0,
                          "media.navigator.video.preferred_codec",
                          preferred_codec);
 }
-
--- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c
+++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_platform_udp.c
@@ -108,17 +108,17 @@ cpr_sockaddr_t *sip_set_sockaddr (cpr_so
 
 int
 sip_platform_udp_channel_listen (cpr_ip_mode_e ip_mode, cpr_socket_t *s,
                                  cpr_ip_addr_t *local_ipaddr,
                                  uint16_t local_port)
 {
     static const char fname[] = "sip_platform_udp_channel_listen";
     cpr_sockaddr_storage sock_addr;
-    uint16_t       addr_len;
+    uint16_t       addr_len = 0;
 
     /*
      * If socket passed is is not INVALID_SOCKET close it first
      */
 
     if (*s != INVALID_SOCKET) {
         if (sipSocketClose(*s, FALSE) != CPR_SUCCESS) {
             CCSIP_DEBUG_ERROR(get_debug_string(DEBUG_GENERAL_SYSTEMCALL_FAILED),
@@ -175,17 +175,17 @@ sip_platform_udp_channel_listen (cpr_ip_
 int
 sip_platform_udp_channel_create (cpr_ip_mode_e ip_mode, cpr_socket_t *s,
                                  cpr_ip_addr_t *remote_ipaddr,
                                  uint16_t remote_port,
                                  uint32_t local_udp_port)
 {
     static const char *fname = "sip_platform_udp_channel_create";
     cpr_sockaddr_storage sock_addr;
-    uint16_t       addr_len;
+    uint16_t       addr_len = 0;
     cpr_sockaddr_storage local_sock_addr;
     cpr_ip_addr_t local_signaladdr;
 
     int tos_dscp_val = 0; // set to default if there is no config. for dscp
 
     CPR_IP_ADDR_INIT(local_signaladdr);
 
     if (*s != INVALID_SOCKET) {