aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorLookUpTable.cpp
diff options
context:
space:
mode:
authorGravatar raftias <raftias@google.com>2016-11-28 11:30:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-28 17:11:44 +0000
commit264431d9e2c4021baa2a5357b0c8c7773384d614 (patch)
treee7da64c4ea161ee3273ef59017c3c5a15a7bcdff /src/core/SkColorLookUpTable.cpp
parent5a130119186271c884fb580e8c0950749e18a4c0 (diff)
Fuzzer fix for overflow in some Lut8 profiles.
Bug(?) in the tetrahedral interpolation causes output values to go out of range a bit (1.035/1.0) in the upper range. We will just clamp for now as a temporary fix. BUG=668784 Change-Id: I78dd90da7174133e647b1c6c6e914dbde5de123c Reviewed-on: https://skia-review.googlesource.com/5228 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
Diffstat (limited to 'src/core/SkColorLookUpTable.cpp')
-rw-r--r--src/core/SkColorLookUpTable.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkColorLookUpTable.cpp b/src/core/SkColorLookUpTable.cpp
index 73f3e8836c..76e0bca369 100644
--- a/src/core/SkColorLookUpTable.cpp
+++ b/src/core/SkColorLookUpTable.cpp
@@ -92,6 +92,13 @@ void SkColorLookUpTable::interp3D(float dst[3], float src[3]) const {
}
}
+ // TODO(raftias): Figure out why this is going out of range (up to 1.0359!)
+ if (dst[i] > 1.f) {
+ dst[i] = 1.f;
+ } else if (dst[i] < 0.f) {
+ dst[i] = 0.f;
+ }
+
// Increment the table ptr in order to handle the next component.
// Note that this is the how table is designed: all of nXXX
// variables are multiples of 3 because there are 3 output