diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c index 10f34323d0..2c1bb79b92 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c @@ -312,10 +312,11 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height) pool = gst_va_pool_new_with_config (caps, GST_VIDEO_INFO_SIZE (&info), 1, 0, VA_SURFACE_ATTRIB_USAGE_HINT_DECODER, GST_VA_FEATURE_AUTO, allocator, ¶ms); + gst_clear_caps (&caps); + if (!pool) { GST_WARNING_OBJECT (self, "Failed to create internal pool"); gst_object_unref (allocator); - gst_clear_caps (&caps); return NULL; } diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c index be36f069c0..2cadb5d497 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c @@ -197,7 +197,7 @@ _get_sinkpad_pool (GstVaBaseEnc * base) GstAllocationParams params = { 0, }; guint size, usage_hint = 0; GArray *surface_formats = NULL; - GstCaps *caps; + GstCaps *caps = NULL; if (base->priv->raw_pool) return base->priv->raw_pool; @@ -217,6 +217,8 @@ _get_sinkpad_pool (GstVaBaseEnc * base) base->priv->raw_pool = gst_va_pool_new_with_config (caps, size, 1, 0, usage_hint, GST_VA_FEATURE_AUTO, allocator, ¶ms); + gst_clear_caps (&caps); + if (!base->priv->raw_pool) { gst_object_unref (allocator); return NULL;