1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Patch by Martyn Shaw to fix a crash when the output of the VST effect does not have exactly two channels - we can now have any reasonable number of outputs from the plugin. This has been crashing windows builds of Audacity.

This commit is contained in:
richardash1981 2014-08-26 21:51:28 +00:00
parent 9156ebab72
commit d2b4eca65b

View File

@ -3073,8 +3073,9 @@ bool VSTEffect::ProcessStereo(int count,
// so overlay them by shifting the remaining output samples.
else if (delay > 0) {
sampleCount oblock = block - delay;
memmove(outBufSegment[0], outBufSegment[0] + delay, SAMPLE_SIZE(floatSample) * oblock);
memmove(outBufSegment[1], outBufSegment[1] + delay, SAMPLE_SIZE(floatSample) * oblock);
for (int i = 0; i < mOutputs; i++) {
memmove(outBufSegment[i], outBufSegment[i] + delay, SAMPLE_SIZE(floatSample) * oblock);
}
delay = 0;
outBufferCursor += oblock;
}