summaryrefslogtreecommitdiff
path: root/libs/hwui/Interpolator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Interpolator.cpp')
-rw-r--r--libs/hwui/Interpolator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/Interpolator.cpp b/libs/hwui/Interpolator.cpp
index cc47f0052b73..bddb01b97865 100644
--- a/libs/hwui/Interpolator.cpp
+++ b/libs/hwui/Interpolator.cpp
@@ -97,7 +97,8 @@ LUTInterpolator::~LUTInterpolator() {
}
float LUTInterpolator::interpolate(float input) {
- float lutpos = input * mSize;
+ // lut position should only be at the end of the table when input is 1f.
+ float lutpos = input * (mSize - 1);
if (lutpos >= (mSize - 1)) {
return mValues[mSize - 1];
}