Demo crash on Windows. 1.46 (audio)


#1

Audio demo from 1.46(download yesterday).

On opening Audio Demo crash on:

for (i = numInputs; i < numOutputs; ++i)
{
    channels[numActiveChans] = outputChans[i];
    /*this line*/zeromem (channels[numActiveChans], sizeof (float) * numSamples);
                ++numActiveChans;
} 

outputChans[1] contain something about 0xcdcdcdcd;
Tested on 2 computers.
On mac all works.

in AudioDeviceManager::CallbackHandler::audioDeviceIOCallback
buffer with channels already corrupted.

Ideas?


#2

Yes, I know… It’s sorted now if you want to grab the tip or the 1.46 tag from SVN.


#3

Thank, I update source.
But i was tried fix the bug myself and find this code

const String DSoundAudioIODevice::openDevice (const BitArray& inputChannels,
                                              const BitArray& outputChannels,
                                              double sampleRate_,
                                              int bufferSizeSamples_)
......
......
    numOutputBuffers = enabledOutputs.countNumberOfSetBits();
    outputBuffers = new float* [numOutputBuffers + 2];
    //zeromem (outputBuffers, sizeof (outputBuffers)); - my comment
    zeromem (outputBuffers, sizeof(float*)*(numOutputBuffers + 2));//my fix
......
......

After this patch it works without last SVN version(this bug in version from SVN too)
outputBuffers is float**,not array, its size 4.
Is it bug? :?:
(same with inputs)


#4

Oh, I changed it from an array and must have missed that line. Your fix is correct, though I don’t think it should actually matter whether the array is initially cleared, because all the channels in it should be proper pointers, and the callback code really shouldn’t read beyond the number of channels it’s told to use.