Skip to content

Commit ae71d68

Browse files
committed
Fix uninitialized use of numChannels
1 parent 50793b4 commit ae71d68

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

Source/Processors/Editors/GenericEditor.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,21 +512,24 @@ void GenericEditor::update()
512512

513513
//std::cout << "Editor for ";
514514

515-
GenericProcessor* p = (GenericProcessor*) getProcessor();
515+
GenericProcessor* p = (GenericProcessor*)getProcessor();
516516

517517
// std::cout << p->getName() << " updating settings." << std::endl;
518518

519-
int numChannels;
519+
updateSettings();
520520

521-
updateSettings();
521+
int numChannels;
522+
if (!p->isSink())
523+
{
524+
numChannels = p->getNumOutputs();
525+
}
526+
else
527+
{
528+
numChannels = p->getNumInputs();
529+
}
522530

523531
if (channelSelector != 0)
524532
{
525-
if (!p->isSink())
526-
numChannels = p->getNumOutputs();
527-
else
528-
numChannels = p->getNumInputs();
529-
530533
channelSelector->setNumChannels(numChannels);
531534

532535
for (int i = 0; i < numChannels; i++)

0 commit comments

Comments
 (0)