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

Commit 361155ac authored by Andy Hung's avatar Andy Hung
Browse files

EffectReverb: Fix unsigned integer overflow

Test: Regression - verified problem exists, can't trigger problem at will.
Bug: 77818338
Change-Id: I3dccf05c27e5048eddc39d58f22b02fba0bb9de1
parent fa33327e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1966,7 +1966,8 @@ int Reverb_process(effect_handle_t self,

    if (pContext->bEnabled == LVM_FALSE) {
        if (pContext->SamplesToExitCount > 0) {
            pContext->SamplesToExitCount -= outBuffer->frameCount;
            // signed - unsigned will trigger integer overflow if result becomes negative.
            pContext->SamplesToExitCount -= (ssize_t)outBuffer->frameCount;
        } else {
            status = -ENODATA;
        }