X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fvst_plugin.cc;h=df93250e180a5fdd39e8a6c2e7bc3d8d66df4d78;hb=08371ae2cf6231bbb8522645d14add41ffa9c1c0;hp=b80a594495d8c936125d3fff58853aeb1f77a35c;hpb=650964f3203319b013c49a286b5fc5fc203f3bbb;p=ardour.git diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index b80a594495..df93250e18 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -298,7 +298,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) char label[64]; /* some VST plugins expect this buffer to be zero-filled */ - memset (label, sizeof (label), 0); + memset (label, 0, sizeof (label)); _plugin->dispatcher (_plugin, effGetParamName, which, 0, label, 0); @@ -528,8 +528,9 @@ VSTPlugin::connect_and_run (BufferSet& bufs, { Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset); - float *ins[_plugin->numInputs]; - float *outs[_plugin->numOutputs]; + // VC++ doesn't support this C99 extension. Use alloca instead of dynamic array (rather than std::vector which allocs on the heap) + float** ins = (float**)alloca(_plugin->numInputs*sizeof(float*)); + float** outs = (float**)alloca(_plugin->numInputs*sizeof(float*)); int32_t i; const uint32_t nbufs = bufs.count().n_audio(); @@ -552,7 +553,7 @@ VSTPlugin::connect_and_run (BufferSet& bufs, } /* we already know it can support processReplacing */ - _plugin->processReplacing (_plugin, ins, outs, nframes); + _plugin->processReplacing (_plugin, &ins[0], &outs[0], nframes); return 0; }