summaryrefslogtreecommitdiff
path: root/libs/hwui/Interpolator.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-06-20 09:59:56 -0700
committerJohn Reck <jreck@google.com>2014-06-20 09:59:56 -0700
commit7aab5a1f9f0be7f84010325d9b7f314540f2d36f (patch)
tree519b1ffc1dbf20d612166a94dedb497051ea3e69 /libs/hwui/Interpolator.cpp
parent9285d1bf9c57e5f1da8f8d8ef7a6a38b2f0e4ec3 (diff)
Add negative guard
Bug: 15631600 Change-Id: Idd7740f58876e73694fafb8ef55ebaff511f6dca
Diffstat (limited to 'libs/hwui/Interpolator.cpp')
-rw-r--r--libs/hwui/Interpolator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/Interpolator.cpp b/libs/hwui/Interpolator.cpp
index 1f84b86bca73..fc0e8a059f22 100644
--- a/libs/hwui/Interpolator.cpp
+++ b/libs/hwui/Interpolator.cpp
@@ -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];