You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Process a block of samples in the given formtemplate <classStateType, typename Sample>
voidprocess (int numSamples, Sample* dest, StateType& state) const
{
while (--numSamples >= 0)
*dest++ = state.process (*dest, *this);
}
There is a very stupid error: the order of calculation of *dest++ and *dest is unspecified (see this question on StackOverflow). It seems that with Visual C++ it does the right thing, but g++ under Linux compiles the other way, resulting in the first sample to be skipped. Moreover, this actually leads to memory corruption in the end. I recommend the following fix:
// Process a block of samples in the given formtemplate <classStateType, typename Sample>
voidprocess (int numSamples, Sample* dest, StateType& state) const
{
while (--numSamples >= 0) {
*dest = state.process (*dest, *this);
dest++;
}
}
The text was updated successfully, but these errors were encountered:
vmarkovtsev
added a commit
to vmarkovtsev/DSPFilters
that referenced
this issue
Dec 3, 2013
# By Vadim Markovtsev
# Via Vadim Markovtsev
* 'master' of https://github.com/vmarkovtsev/DSPFilters:
Disabled SSE by default (leads to speed degradation)
Added RASTA filter
Weakened poles/zeros assertion in LayoutBase
Made Cascade::applyScale overridable
Fixed further Biquad memory corruptions (see vinniefalco#15)
Renamed PoleFilterBase-s, turned PoleFilterBase2 into a template
Cascade.h, near line 181:
There is a very stupid error: the order of calculation of *dest++ and *dest is unspecified (see this question on StackOverflow). It seems that with Visual C++ it does the right thing, but g++ under Linux compiles the other way, resulting in the first sample to be skipped. Moreover, this actually leads to memory corruption in the end. I recommend the following fix:
The text was updated successfully, but these errors were encountered: