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

Commit 09164237 authored by John Reck's avatar John Reck Committed by Android (Google) Code Review
Browse files

Merge "Add negative guard"

parents 626861c5 7aab5a1f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ float LUTInterpolator::interpolate(float input) {
    int i1 = (int) ipart;
    int i2 = MathUtils::min(i1 + 1, mSize - 1);

    LOG_ALWAYS_FATAL_IF(i1 < 0 || i2 < 0, "negatives in interpolation!"
            " i1=%d, i2=%d, input=%f, lutpos=%f, size=%zu, values=%p, ipart=%f, weight=%f",
            i1, i2, input, lutpos, mSize, mValues, ipart, weight);

    float v1 = mValues[i1];
    float v2 = mValues[i2];