wfd: Fix coverity issues (MISSING_LOCK) 09/304409/3
authorYoungwoo Cho <young222.cho@samsung.com>
Wed, 17 Jan 2024 04:14:35 +0000 (13:14 +0900)
committerYoungwoo Cho <young222.cho@samsung.com>
Thu, 18 Jan 2024 04:59:08 +0000 (13:59 +0900)
- Add lock phase

[Version] 1.22.8-0
[Issue Type] Coverity

Change-Id: I57d6c8bc846b97ce1273f18fdbdd7b3bf0eee5ca
Signed-off-by: Youngwoo Cho <young222.cho@samsung.com>
packaging/gst-plugins-tizen.spec
wfdmanager/wfdbase/gstwfdbasesrc.c
wfdtsdemux/wfdtspacketizer.c

index d1da278..5867a64 100644 (file)
@@ -3,9 +3,9 @@
 %define gst_branch 1.0
 
 Name:       gst-plugins-tizen
-Version:    1.22.0
+Version:    1.22.8
 Summary:    GStreamer tizen plugins (common)
-Release:    11
+Release:    0
 Group:      Multimedia/Framework
 Url:        http://gstreamer.freedesktop.org/
 License:    LGPL-2.1+
index cf9c8c7..82ff495 100644 (file)
@@ -1194,10 +1194,13 @@ gst_wfd_base_src_conninfo_connect (GstWFDBaseSrc * src, GstWFDConnInfo * info)
     GST_DEBUG_OBJECT (src, "connecting (%s)...", info->location);
     int retry = 0;
   connect_retry:
+    GST_OBJECT_LOCK (src);
     if (priv->do_stop) {
+      GST_OBJECT_UNLOCK (src);
       GST_ERROR_OBJECT (src, "stop connecting....");
       return GST_RTSP_EINTR;
     }
+    GST_OBJECT_UNLOCK (src);
 
     if ((res =
             gst_rtsp_connection_connect (info->connection,
index d87839d..9e9894c 100644 (file)
@@ -2098,13 +2098,17 @@ wfd_ts_packetizer_offset_to_ts (WFDTSPacketizer * packetizer,
   if (G_UNLIKELY (!packetizer->calculate_offset))
     return GST_CLOCK_TIME_NONE;
 
-  if (G_UNLIKELY (packetizer->refoffset == -1))
-    return GST_CLOCK_TIME_NONE;
+  PACKETIZER_GROUP_LOCK (packetizer);
 
-  if (G_UNLIKELY (offset < packetizer->refoffset))
+  if (G_UNLIKELY (packetizer->refoffset == -1)) {
+    PACKETIZER_GROUP_UNLOCK (packetizer);
     return GST_CLOCK_TIME_NONE;
+  }
 
-  PACKETIZER_GROUP_LOCK (packetizer);
+  if (G_UNLIKELY (offset < packetizer->refoffset)) {
+    PACKETIZER_GROUP_UNLOCK (packetizer);
+    return GST_CLOCK_TIME_NONE;
+  }
 
   pcrtable = get_pcr_table (packetizer, pid);
   if(pcrtable == NULL) {