From 1eed9de0bb786d2270c7caac32df8c1cadcc32f5 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Sat, 12 Feb 2022 14:51:51 +0800 Subject: [PATCH] vavpp: Fix the caps leak in the transform_caps() function. Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvavpp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c index d85bfa741d..c781526317 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c @@ -986,17 +986,26 @@ gst_va_vpp_transform_caps (GstBaseTransform * trans, GstPadDirection direction, ret = gst_va_vpp_caps_remove_fields (caps); tmp = gst_va_vpp_complete_caps_features (ret, GST_CAPS_FEATURE_MEMORY_VA); - if (!gst_caps_is_subset (tmp, ret)) + if (!gst_caps_is_subset (tmp, ret)) { gst_caps_append (ret, tmp); + } else { + gst_caps_unref (tmp); + } tmp = gst_va_vpp_complete_caps_features (ret, GST_CAPS_FEATURE_MEMORY_DMABUF); - if (!gst_caps_is_subset (tmp, ret)) + if (!gst_caps_is_subset (tmp, ret)) { gst_caps_append (ret, tmp); + } else { + gst_caps_unref (tmp); + } tmp = gst_va_vpp_complete_caps_features (ret, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); - if (!gst_caps_is_subset (tmp, ret)) + if (!gst_caps_is_subset (tmp, ret)) { gst_caps_append (ret, tmp); + } else { + gst_caps_unref (tmp); + } bail: if (filter) {