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

Commit 7e6af732 authored by Dan Austin's avatar Dan Austin Committed by android-build-merger
Browse files

Merge "Fix benign integer overflow conditions for VSYNC add and removal."

am: 34efca16

* commit '34efca16':
  Fix benign integer overflow conditions for VSYNC add and removal.
parents 2872879d 34efca16
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -460,6 +460,7 @@ nsecs_t VideoFrameScheduler::schedule(nsecs_t renderTime) {
                mTimeCorrection -= mVsyncPeriod / 2;
                renderTime -= mVsyncPeriod / 2;
                nextVsyncTime -= mVsyncPeriod;
                if (vsyncsForLastFrame > 0)
                    --vsyncsForLastFrame;
            } else if (mTimeCorrection < -correctionLimit &&
                    (vsyncsPerFrameAreNearlyConstant || vsyncsForLastFrame == minVsyncsPerFrame)) {
@@ -467,6 +468,7 @@ nsecs_t VideoFrameScheduler::schedule(nsecs_t renderTime) {
                mTimeCorrection += mVsyncPeriod / 2;
                renderTime += mVsyncPeriod / 2;
                nextVsyncTime += mVsyncPeriod;
                if (vsyncsForLastFrame < ULONG_MAX)
                    ++vsyncsForLastFrame;
            }
            ATRACE_INT("FRAME_VSYNCS", vsyncsForLastFrame);