Skip to content
Snippets Groups Projects
Commit d10244ec authored by Lyndon Brown's avatar Lyndon Brown
Browse files

config: fix mistimed sanity check

A null check of `param` needs to be done before it is ever dereferenced,
even if you're just setting up a pointer. This is the sort of situation
where the compiler might be mislead into thinking that it is safe to
optimise the sanity check away.
parent 17604330
No related branches found
No related tags found
No related merge requests found
Pipeline #186789 passed with stage
in 18 minutes and 5 seconds
......@@ -148,10 +148,9 @@ void config_PutPsz(const char *psz_name, const char *psz_value)
void config_PutInt(const char *name, int64_t i_value)
{
struct vlc_param *param = vlc_param_Find(name);
assert(param != NULL);
module_config_t *p_config = &param->item;
/* sanity checks */
assert(param != NULL);
assert(IsConfigIntegerType(param->item.i_type));
if (i_value < p_config->min.i)
......@@ -169,10 +168,9 @@ void config_PutInt(const char *name, int64_t i_value)
void config_PutFloat(const char *name, float f_value)
{
struct vlc_param *param = vlc_param_Find(name);
assert(param != NULL);
module_config_t *p_config = &param->item;
/* sanity checks */
assert(param != NULL);
assert(IsConfigFloatType(param->item.i_type));
/* if f_min == f_max == 0, then do not use them */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment