Commit 318c24cb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

modules: fix race in module_Map()

parent 678a61d1
......@@ -639,23 +639,31 @@ static module_t *module_InitStatic (vlc_plugin_cb entry)
int module_Map (vlc_object_t *obj, module_t *module)
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
if (module->parent != NULL)
module = module->parent;
#warning FIXME: race condition!
if (module->b_loaded)
return 0;
assert (module->psz_filename != NULL);
if (!module->b_loaded)
module_t *uncache;
assert (module->psz_filename != NULL);
module_t *uncache = module_InitDynamic (obj, module->psz_filename, false);
uncache = module_InitDynamic (obj, module->psz_filename, false);
if (uncache != NULL)
CacheMerge (obj, module, uncache);
vlc_module_destroy (uncache);
return 0;
msg_Err (obj, "corrupt module: %s", module->psz_filename);
return -1;
module = NULL;
return -(module == NULL);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment