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

Commit f536e9d8 authored by Ivan Lozano's avatar Ivan Lozano Committed by android-build-merger
Browse files

Merge "Fix integer sanitizer in FastMixerDumpState." am: 02052ff3

am: 30fad58e

Change-Id: I3a18825b33ea3167d6132c644537f6a2f5ed498f
parents 5f63fc27 30fad58e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -78,7 +78,12 @@ void FastMixerDumpState::dump(int fd) const
    uint32_t bounds = mBounds;
    uint32_t newestOpen = bounds & 0xFFFF;
    uint32_t oldestClosed = bounds >> 16;
    uint32_t n = (newestOpen - oldestClosed) & 0xFFFF;

    //uint32_t n = (newestOpen - oldestClosed) & 0xFFFF;
    uint32_t n;
    __builtin_sub_overflow(newestOpen, oldestClosed, &n);
    n = n & 0xFFFF;

    if (n > mSamplingN) {
        ALOGE("too many samples %u", n);
        n = mSamplingN;