From d6db8ef9446d82d5112f277d7c22554d3e8640d1 Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Thu, 27 Apr 2023 21:05:53 +0900 Subject: [PATCH] good:pulse: add null check for mainloop access while handling of query caps [Version] 1.22.0-28 [Issue Type] Bug fix Change-Id: I7d80321f1ae0041407a6a6f429767f8eaf92fc0b --- packaging/gstreamer.spec | 2 +- subprojects/gst-plugins-good/ext/pulse/pulsesink.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 0b3e67a..36664e9 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -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 diff --git a/subprojects/gst-plugins-good/ext/pulse/pulsesink.c b/subprojects/gst-plugins-good/ext/pulse/pulsesink.c index 552d443..f12db5e 100644 --- a/subprojects/gst-plugins-good/ext/pulse/pulsesink.c +++ b/subprojects/gst-plugins-good/ext/pulse/pulsesink.c @@ -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; -- 2.7.4