From: Seungbae Shin Date: Thu, 27 Apr 2023 12:05:53 +0000 (+0900) Subject: good:pulse: add null check for mainloop access while handling of query caps X-Git-Tag: accepted/tizen/unified/20230605.170352~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6db8ef9446d82d5112f277d7c22554d3e8640d1;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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;