Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

IPlugVST3 might crash the Plugin when initalizing reqNumInputChannels or reqNumOutputChannels #60

Open
theodark opened this issue Sep 8, 2016 · 0 comments

Comments

@theodark
Copy link

theodark commented Sep 8, 2016

Lines 278 and 279 at IPlugVST3 might cause an access violation if the 'inputs' or 'outputs' arrays are empty (for example in a VST instrument). I've encountered this error in Win x64 Debug configuration of my VST3 plugin.

It would be safer if the code looked if there are any channels initialized and then get their speaker arrangement. For example.

  int32 reqNumInputChannels = 0;
  if(NInChannels() > 0)
      reqNumInputChannels = SpeakerArr::getChannelCount(inputs[0]);  //requested # input channels
  int32 reqNumOutputChannels = 0;
  if(NOutChannels() > 0)
      reqNumOutputChannels = SpeakerArr::getChannelCount(outputs[0]);//requested # output channels

  • I'm sorry if I'm doing something wrong its the first time I try to contribute to Github :)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant