diff options
author | David Robillard <d@drobilla.net> | 2011-05-18 03:24:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-18 03:24:34 +0000 |
commit | 679262970e2d9da0e63ef58e7c575842bbcf34bc (patch) | |
tree | d18a30ab5210323896841e59cb53bd9015d98430 | |
parent | f5a258e0b9740a57dd14c93a65e1b19ab5fd964f (diff) | |
download | lilv-679262970e2d9da0e63ef58e7c575842bbcf34bc.tar.gz lilv-679262970e2d9da0e63ef58e7c575842bbcf34bc.tar.bz2 lilv-679262970e2d9da0e63ef58e7c575842bbcf34bc.zip |
Fix crash introduced in last commit. Oops.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3276 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/plugin.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/plugin.c b/src/plugin.c index 25cc781..cfb3398 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -453,7 +453,9 @@ lilv_plugin_get_port_ranges_float(const LilvPlugin* p, float* def_values) { lilv_plugin_load_ports_if_necessary(p); - LilvNode *min, *max, *def; + LilvNode* min = NULL; + LilvNode* max = NULL; + LilvNode* def = NULL; LilvNode** minptr = min_values ? &min : NULL; LilvNode** maxptr = max_values ? &max : NULL; LilvNode** defptr = def_values ? &def : NULL; @@ -461,17 +463,20 @@ lilv_plugin_get_port_ranges_float(const LilvPlugin* p, for (uint32_t i = 0; i < p->num_ports; ++i) { lilv_port_get_range(p, p->ports[i], defptr, minptr, maxptr); - min_values[i] = (minptr && lilv_node_is_float(min)) - ? lilv_node_as_float(min) - : NAN; + if (min_values) + min_values[i] = lilv_node_is_float(min) + ? lilv_node_as_float(min) + : NAN; - max_values[i] = (maxptr && lilv_node_is_float(max)) - ? lilv_node_as_float(max) - : NAN; + if (max_values) + max_values[i] = lilv_node_is_float(max) + ? lilv_node_as_float(max) + : NAN; - def_values[i] = (defptr && lilv_node_is_float(def)) - ? lilv_node_as_float(def) - : NAN; + if (def_values) + def_values[i] = lilv_node_is_float(def) + ? lilv_node_as_float(def) + : NAN; lilv_node_free(def); lilv_node_free(min); |