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

Commit 74b739d7 authored by Shunkai Yao's avatar Shunkai Yao Committed by Gerrit Code Review
Browse files

Merge "Check work buffer size before effect process" into main

parents b773bae2 d0e64b13
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);