va: encoder: Fix error code path when open.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 3 Mar 2022 13:08:16 +0000 (14:08 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 4 Mar 2022 12:41:37 +0000 (12:41 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1845>

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

index a07fcef..7731fcc 100644 (file)
@@ -482,10 +482,10 @@ error:
   g_clear_pointer (&reconstruct_buffers, g_ptr_array_unref);
   g_clear_pointer (&recon_pool, gst_object_unref);
 
-  if (config == VA_INVALID_ID)
+  if (config != VA_INVALID_ID)
     vaDestroyConfig (dpy, config);
 
-  if (context == VA_INVALID_ID)
+  if (context != VA_INVALID_ID)
     vaDestroyContext (dpy, context);
 
   return FALSE;