va: vpp: Fix the memory leak in fixate_caps().
authorHe Junyan <junyan.he@intel.com>
Mon, 22 Nov 2021 09:34:22 +0000 (17:34 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 22 Nov 2021 10:54:23 +0000 (10:54 +0000)
For the BaseTransform class, the function of fixate_caps(), takes
the ownership of "othercaps". So we should clear it in our subclass.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1372>

subprojects/gst-plugins-bad/sys/va/gstvavpp.c

index e056e3f..6669986 100644 (file)
@@ -1707,6 +1707,8 @@ gst_va_vpp_fixate_caps (GstBaseTransform * trans, GstPadDirection direction,
   if (!result)
     return othercaps;
 
+  gst_clear_caps (&othercaps);
+
   gst_va_vpp_fixate_size (self, direction, caps, result);
 
   /* some fields might be lost while feature caps conversion */