good:pulse: add null check for mainloop access while handling of query caps 31/292331/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, 4 May 2023 05:03:30 +0000 (14:03 +0900)
[Version] 1.20.0-46
[Issue Type] Bug fix

Change-Id: I7d80321f1ae0041407a6a6f429767f8eaf92fc0b

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

index 785bca206ecffb8ce55e543abfe53c06e56adda8..da7faf01def558908635e396512ce151bb91b02a 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        45
+Release:        46
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index 85d83cb31e3cfd63b2e9f5f1006aec27fb474fd9..5e85eb36fc2f11e7991a54b6c4fa4af48659400d 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;