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

Commit 2396cfe0 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "AudioFlinger: Fix unsigned overflow" into main

parents b2c6ab1b 7a6a0f0a
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -7747,7 +7747,8 @@ void DuplicatingThread::sendMetadataToBackend_l(


uint32_t DuplicatingThread::activeSleepTimeUs() const
uint32_t DuplicatingThread::activeSleepTimeUs() const
{
{
    return (mWaitTimeMs * 1000) / 2;
    // return half the wait time in microseconds.
    return std::min(mWaitTimeMs * 500ULL, (unsigned long long)UINT32_MAX);  // prevent overflow.
}
}


void DuplicatingThread::cacheParameters_l()
void DuplicatingThread::cacheParameters_l()