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

Commit 46357d55 authored by Chad Brubaker's avatar Chad Brubaker Committed by Marco Nelissen
Browse files

Fix harmless unsigned overflow in recoverPTS

Change-Id: I89e3a827cf566421e8dd9b6a3c842e73a19c140f
parent ad69e73b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ int64_t ATSParser::Program::recoverPTS(uint64_t PTS_33bit) {
        mLastRecoveredPTS = static_cast<int64_t>(PTS_33bit);
    } else {
        mLastRecoveredPTS = static_cast<int64_t>(
                ((mLastRecoveredPTS - PTS_33bit + 0x100000000ll)
                ((mLastRecoveredPTS - static_cast<int64_t>(PTS_33bit) + 0x100000000ll)
                & 0xfffffffe00000000ull) | PTS_33bit);
        // We start from 0, but recovered PTS could be slightly below 0.
        // Clamp it to 0 as rest of the pipeline doesn't take negative pts.