From 5a2e1ecb4d82a28aa735d829eb8ecfaaae34674f Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sat, 12 Feb 2022 10:05:11 +0000 Subject: [PATCH] dtlstransport: Notify ICE transport property changes The application might track the underlying ICE transport, so not notifying changes might lead to use-after-free issues. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/webrtc/dtlstransport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/dtlstransport.c b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/dtlstransport.c index c401f7f..e3d54a0 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/dtlstransport.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/dtlstransport.c @@ -64,12 +64,19 @@ void gst_webrtc_dtls_transport_set_transport (GstWebRTCDTLSTransport * transport, GstWebRTCICETransport * ice) { + gboolean notify = FALSE; + g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport)); g_return_if_fail (GST_IS_WEBRTC_ICE_TRANSPORT (ice)); GST_OBJECT_LOCK (transport); - gst_object_replace ((GstObject **) & transport->transport, GST_OBJECT (ice)); + notify = + gst_object_replace ((GstObject **) & transport->transport, + GST_OBJECT (ice)); GST_OBJECT_UNLOCK (transport); + + if (notify) + g_object_notify (G_OBJECT (transport), "transport"); } static void -- 2.7.4