From e3674a3e423e7ebf77e093523f28ed6cd8843756 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 08a1e7fd9a..ccf912fd25 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c @@ -351,7 +351,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; } @@ -362,6 +361,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; }