From d9edf16e55663cb8374b370e370bdcc8f98284e8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 31 May 2012 06:47:21 +0000 Subject: Fix memory errors. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4490 a436a847-0d15-0410-975c-d299462d15a1 --- src/fmod.c | 1 + src/lp4pole.c | 1 + src/quantiser.c | 12 ++++++++++-- src/random.c | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fmod.c b/src/fmod.c index d566418..e57de5f 100644 --- a/src/fmod.c +++ b/src/fmod.c @@ -118,6 +118,7 @@ instantiate(const LV2_Descriptor* descriptor, if (plugin) { plugin->frequency_is_cv = 0; plugin->modulator_is_cv = 0; + map_uris(&plugin->uris, features); } return (LV2_Handle)plugin; diff --git a/src/lp4pole.c b/src/lp4pole.c index 1997ae3..64d4bba 100644 --- a/src/lp4pole.c +++ b/src/lp4pole.c @@ -116,6 +116,7 @@ instantiate(const LV2_Descriptor* descriptor, } plugin->cutoff_is_cv = 0; plugin->resonance_is_cv = 0; + map_uris(&plugin->uris, features); } return (LV2_Handle)plugin; diff --git a/src/quantiser.c b/src/quantiser.c index 419467f..8607359 100644 --- a/src/quantiser.c +++ b/src/quantiser.c @@ -153,6 +153,14 @@ cleanup(LV2_Handle instance) free(instance); } +static void +activate(LV2_Handle instance) +{ + Quantiser* plugin = (Quantiser*)instance; + + plugin->last_found = 0.0f; +} + static void connect_port(LV2_Handle instance, uint32_t port, @@ -246,7 +254,7 @@ run(LV2_Handle instance, float out_changed; float range; float offset; - float found; + float found = last_found; int found_index = 0; /* Clip count if out of range */ @@ -436,7 +444,7 @@ static const LV2_Descriptor descriptor = { QUANTISER_URI, instantiate, connect_port, - NULL, + activate, run, NULL, cleanup, diff --git a/src/random.c b/src/random.c index 1671854..2a4a7b7 100644 --- a/src/random.c +++ b/src/random.c @@ -122,6 +122,8 @@ instantiate(const LV2_Descriptor* descriptor, plugin->frequency_is_cv = 0; plugin->smooth_is_cv = 0; + map_uris(&plugin->uris, features); + return (LV2_Handle)plugin; } -- cgit v1.2.1