va: Fix the caps memory leak by gst_va_pool_new_with_config().
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / va / gstvaav1dec.c
index 10f3432..2c1bb79 100644 (file)
@@ -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, &params);
+  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;
   }