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

Commit bffbd09f authored by Dan Austin's avatar Dan Austin Committed by Gerrit Code Review
Browse files

Merge "Eliminate multiple benign overflow conditions."

parents 64b83133 1faef801
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -510,7 +510,8 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory,
status_t InputConsumer::consumeBatch(InputEventFactoryInterface* factory,
        nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent) {
    status_t result;
    for (size_t i = mBatches.size(); i-- > 0; ) {
    for (size_t i = mBatches.size(); i > 0; ) {
        i--;
        Batch& batch = mBatches.editItemAt(i);
        if (frameTime < 0) {
            result = consumeSamples(factory, batch, batch.samples.size(),
@@ -815,7 +816,8 @@ status_t InputConsumer::sendFinishedSignal(uint32_t seq, bool handled) {
        uint32_t currentSeq = seq;
        uint32_t chainSeqs[seqChainCount];
        size_t chainIndex = 0;
        for (size_t i = seqChainCount; i-- > 0; ) {
        for (size_t i = seqChainCount; i > 0; ) {
             i--;
             const SeqChain& seqChain = mSeqChains.itemAt(i);
             if (seqChain.seq == currentSeq) {
                 currentSeq = seqChain.chain;
@@ -824,7 +826,8 @@ status_t InputConsumer::sendFinishedSignal(uint32_t seq, bool handled) {
             }
        }
        status_t status = OK;
        while (!status && chainIndex-- > 0) {
        while (!status && chainIndex > 0) {
            chainIndex--;
            status = sendUnchainedFinishedSignal(chainSeqs[chainIndex], handled);
        }
        if (status) {
@@ -834,7 +837,10 @@ status_t InputConsumer::sendFinishedSignal(uint32_t seq, bool handled) {
                seqChain.seq = chainIndex != 0 ? chainSeqs[chainIndex - 1] : seq;
                seqChain.chain = chainSeqs[chainIndex];
                mSeqChains.push(seqChain);
            } while (chainIndex-- > 0);
                if (chainIndex != 0) {
                    chainIndex--;
                }
            } while (chainIndex > 0);
            return status;
        }
    }