From c5b1eecb69309867841b40a41185955c5165085d Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 21 Apr 2022 00:38:37 +0900 Subject: [PATCH] webrtcbin: Avoid access of freed memory Part-of: --- subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index c847c09e35..a1c7fa0bcf 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -1886,7 +1886,6 @@ _find_codec_preferences (GstWebRTCBin * webrtc, caps = _query_pad_caps (webrtc, rtp_trans, pad, filter, error); } - gst_object_unref (pad); if (*error) goto out; @@ -1940,6 +1939,8 @@ _find_codec_preferences (GstWebRTCBin * webrtc, out: + if (pad) + gst_object_unref (pad); if (codec_preferences) gst_caps_unref (codec_preferences);