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

Commit 934017e5 authored by Rachel Lee's avatar Rachel Lee
Browse files

Fix floating point exception fuzz.

In VSyncPredictor::addVsyncTimestamp.

Bug: 240218946
Test: atest VSyncPredictorTest
Change-Id: I65272504d90d1b30d3158a01b143efe1f50d6857
parent 29bfcc33
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -167,7 +167,9 @@ bool VSyncPredictor::addVsyncTimestamp(nsecs_t timestamp) {
        vsyncTS[i] = timestamp;
        meanTS += timestamp;

        const auto ordinal = (vsyncTS[i] + currentPeriod / 2) / currentPeriod * kScalingFactor;
        const auto ordinal = currentPeriod == 0
                ? 0
                : (vsyncTS[i] + currentPeriod / 2) / currentPeriod * kScalingFactor;
        ordinals[i] = ordinal;
        meanOrdinal += ordinal;
    }