good:pulse: add null check for mainloop access while handling of query caps 40/292140/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 27 Apr 2023 12:05:53 +0000 (21:05 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 27 Apr 2023 12:07:28 +0000 (21:07 +0900)
[Version] 1.22.0-28
[Issue Type] Bug fix

Change-Id: I7d80321f1ae0041407a6a6f429767f8eaf92fc0b

packaging/gstreamer.spec
subprojects/gst-plugins-good/ext/pulse/pulsesink.c

index 0b3e67a..36664e9 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.0
-Release:        27
+Release:        28
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index 552d443..f12db5e 100644 (file)
@@ -2268,6 +2268,13 @@ gst_pulsesink_query_getcaps (GstPulseSink * psink, GstCaps * filter)
     goto out;
   }
 
+#ifdef TIZEN_FEATURE_PULSE_MODIFICATION
+  if (mainloop) {
+    GST_WARNING_OBJECT (psink, "Invalid mainloop!!!");
+    goto out;
+  }
+#endif
+
   GST_OBJECT_LOCK (pbuf);
   pa_threaded_mainloop_lock (mainloop);
 
@@ -2402,6 +2409,13 @@ gst_pulsesink_query_acceptcaps (GstPulseSink * psink, GstCaps * caps)
   if (pbuf == NULL)
     goto done;
 
+#ifdef TIZEN_FEATURE_PULSE_MODIFICATION
+  if (mainloop) {
+    GST_WARNING_OBJECT (psink, "Invalid mainloop!!!");
+    goto done;
+  }
+#endif
+
   GST_OBJECT_LOCK (pbuf);
   pa_threaded_mainloop_lock (mainloop);
 
@@ -3455,7 +3469,11 @@ gst_pulsesink_release_mainloop (GstPulseSink * psink)
   g_mutex_lock (&pa_shared_resource_mutex);
   mainloop_ref_ct--;
   if (!mainloop_ref_ct) {
+#ifdef TIZEN_FEATURE_PULSE_MODIFICATION
+    GST_WARNING_OBJECT (psink, "terminating pa main loop thread");
+#else
     GST_INFO_OBJECT (psink, "terminating pa main loop thread");
+#endif
     pa_threaded_mainloop_stop (mainloop);
     pa_threaded_mainloop_free (mainloop);
     mainloop = NULL;