From 921c93a9af48366c49c52a39157b104a2cd3b03f Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 21 Feb 2023 15:19:35 +1100 Subject: [PATCH] ccconverter: don't debug a potentially freed filter caps Fixes a use-after-free Part-of: --- subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c b/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c index 14ac7c6884..862391395b 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c @@ -352,7 +352,6 @@ gst_cc_converter_transform_caps (GstBaseTransform * base, tmp = gst_caps_intersect_full (filter, res, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (res); - gst_caps_unref (filter); res = tmp; } @@ -363,6 +362,8 @@ gst_cc_converter_transform_caps (GstBaseTransform * base, GST_DEBUG_OBJECT (self, "filter %" GST_PTR_FORMAT, filter); GST_DEBUG_OBJECT (self, "to %" GST_PTR_FORMAT, res); + gst_clear_caps (&filter); + return res; }