Skip to content

Commit

Permalink
NearestN: check buffer dimensions in _next not ctor (in case changed …
Browse files Browse the repository at this point in the history
…on-the-fly)
  • Loading branch information
danstowell committed Feb 26, 2013
1 parent 40e4e56 commit 5e85661
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/MCLDUGens/MCLDTreeUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@ void NearestN_Ctor(NearestN* unit){
{
GET_BUF

if((int)bufChannels != (ndims + 3)){
Print("NearestN: number of channels in buffer (%i) != number of input dimensions (%i) + 3\n",
bufChannels, ndims);
SETCALC(*ClearUnitOutputs);
return;
}

// initialize the unit generator state variables.
unit->m_ndims = ndims;
unit->m_num = num;
Expand Down Expand Up @@ -290,6 +283,13 @@ void NearestN_ascend(const int fromLeaf, const int asFarAs, const int ndims, con
void NearestN_next(NearestN *unit, int inNumSamples){
GET_BUF
int ndims = unit->m_ndims;
if((int)bufChannels != (ndims + 3)){
Print("NearestN: number of channels in buffer (%i) != number of input dimensions (%i) + 3\n",
bufChannels, ndims);
SETCALC(*ClearUnitOutputs);
return;
}

int num = unit->m_num;
float* bestlist = unit->m_bestlist;
float* inputdata = unit->m_inputdata;
Expand Down

0 comments on commit 5e85661

Please sign in to comment.