Skip to content

canProcessInPlace crash when false #46

Open
@NickCulbertson

Description

@NickCulbertson

macOS Version(s) Used to Build

macOS 13 Ventura

Xcode Version(s)

Xcode 14

Description

When DSPBase is passed canProcessInPlace=false from SoundpipeDSPBase, it crashes when some effects are bypassed (like PhaseLockedVocoder).

The crash occurs on auto input = (const float *)inputBufferLists[0]->mBuffers[channel].mData + bufferOffset; here:


    if (isStarted) {
        process(FrameRange{bufferOffset, frameCount});
    } else {

        // Advance all ramps.
        stepRampsBy(frameCount);

        // Copy input to output.
        if (inputBufferLists.size() and !bCanProcessInPlace) {
            for (int channel=0; channel< channelCount; ++channel) {
                auto input = (const float *)inputBufferLists[0]->mBuffers[channel].mData + bufferOffset;
                auto output = (float *)outputBufferList->mBuffers[channel].mData + bufferOffset;
                std::copy(input, input+frameCount, output);
            }
        }

        // Generators should be silent.
        if (inputBufferLists.empty()) {
            zeroOutput(frameCount, bufferOffset);
        }
    }

}

This is only an issue when canProcessInPlace is false. Otherwise that block is never called.

Example: https://github.com/maweibezahn/PhaseLockedVocoderCrash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions