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

Commit 34efca16 authored by Dan Austin's avatar Dan Austin Committed by Gerrit Code Review
Browse files

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

parents b2350f2e c1d653bb
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);