autoconvert: Fix lock-less exchange or free condition
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 19 Dec 2019 20:19:29 +0000 (15:19 -0500)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 19 Dec 2019 22:35:18 +0000 (22:35 +0000)
Before this change, we would free the list we just have saved.

Fixes #1158

gst/autoconvert/gstautoconvert.c

index 46bec13..7bf7cac 100644 (file)
@@ -895,7 +895,7 @@ gst_auto_convert_load_factories (GstAutoConvert * autoconvert)
 
   g_assert (all_factories);
 
-  if (g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
+  if (!g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
           all_factories)) {
     gst_plugin_feature_list_free (all_factories);
   }