webrtcbin: Fix pointer dereference before null check 36/274136/4 submit/tizen/20220425.020050
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 22 Apr 2022 02:51:07 +0000 (11:51 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 22 Apr 2022 06:02:12 +0000 (15:02 +0900)
Unnecessary null check is also removed.
Typo of definition is fixed.
meson.build for bad plugin is revised to enable required
definition.

[Version] 1.20.0-19
[Issue Type] Coverity defects fix

Change-Id: Icfac5230bb9dddc7dc4d0572f10dd0bc306b20cc
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
subprojects/gst-plugins-bad/meson.build

index f2c938433462249982931613c29483dbef8143dc..5f5e7814e69513d015498a3e2624e0a90dcacec2 100644 (file)
@@ -60,7 +60,7 @@
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        18
+Release:        19
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index d30b359baa76aafb6526b10fcd09f1e4fbea3f69..2280e438bded41ca5390f472769ee158f41fa74e 100644 (file)
@@ -1919,7 +1919,9 @@ _find_codec_preferences (GstWebRTCBin * webrtc,
     }
 
     if (caps) {
+#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATION
       if (trans)
+#endif
         gst_caps_replace (&trans->last_configured_caps, caps);
 
       ret = caps;
@@ -5837,6 +5839,14 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
         continue;
       }
 
+#ifdef TIZEN_FEATURE_FIX_SEG_FAULT
+      if (!pad->trans) {
+        GST_LOG_OBJECT (pad, "doesn't have a transceiver");
+        tmp = tmp->next;
+        continue;
+      }
+
+#endif
       if (pad->trans->mline >= gst_sdp_message_medias_len (sd->sdp->sdp)) {
         GST_DEBUG_OBJECT (pad, "not mentioned in this description. Skipping");
         tmp = tmp->next;
@@ -5853,12 +5863,14 @@ _set_description_task (GstWebRTCBin * webrtc, struct set_description *sd)
         continue;
       }
 
+#ifndef TIZEN_FEATURE_FIX_SEG_FAULT
       if (!pad->trans) {
         GST_LOG_OBJECT (pad, "doesn't have a transceiver");
         tmp = tmp->next;
         continue;
       }
 
+#endif
       new_dir = pad->trans->direction;
       if (new_dir != GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY &&
           new_dir != GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV) {
@@ -6805,14 +6817,10 @@ out:
   return ret;
 
 error:
-#ifndef TIZEN_FEATURE_WEBRTC_MODIFICATON
   if (ret)
     gst_object_unref (ret);
-#else
-  if (ret) {
-    gst_object_unref (ret);
-    ret = NULL;
-  }
+#ifdef TIZEN_FEATURE_WEBRTC_MODIFICATION
+  ret = NULL;
 #endif
   goto out;
 }
index d9697dfb1b866dd9ab85e9415c34ebe2eca0808d..1502fb398e7e6bd9efca93be87125d6cda1b8d61 100644 (file)
@@ -433,6 +433,7 @@ endif
 
 # TIZEN_FEATURE_XXX can be generally used for all of modules in this subproject
 cdata.set('TIZEN_FEATURE_FIX_MEMORY_LEAK', true)
+cdata.set('TIZEN_FEATURE_FIX_SEG_FAULT', true)
 
 # TIZEN_FEATURE_[MODULE]_XXX should be used for a particular module
 cdata.set('TIZEN_FEATURE_ADAPTIVE_MODIFICATION', true)