From 416728f21393b98acd4a13082a20de24c6a1fec0 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 19 Dec 2019 15:19:29 -0500 Subject: [PATCH] autoconvert: Fix lock-less exchange or free condition Before this change, we would free the list we just have saved. Fixes #1158 --- gst/autoconvert/gstautoconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 46bec13..7bf7cac 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -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); } -- 2.7.4