Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a972243 authored by Shunkai Yao's avatar Shunkai Yao Committed by Automerger Merge Worker
Browse files

Merge "Check work buffer size before effect process" into main am: 74b739d7

parents 7ebd8f44 74b739d7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -195,6 +195,8 @@ void DownmixImpl::process() {
        const auto availableToWrite = outputMQ->availableToWrite() *
                                      mImplContext->getInputFrameSize() /
                                      mImplContext->getOutputFrameSize();
        assert(mImplContext->getWorkBufferSize() >=
               std::max(availableToRead(), availableToWrite));
        auto processSamples = std::min(availableToRead, availableToWrite);
        if (processSamples) {
            inputMQ->read(buffer, processSamples);