Fix fuzzer assert in GradientShaderBase4fContext::TSampler
authorfmalita <fmalita@chromium.org>
Wed, 9 Nov 2016 19:58:10 +0000 (11:58 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 9 Nov 2016 19:58:10 +0000 (11:58 -0800)
commit8ffb3e5d4c3731d02b3502a89c7a7eb18daf398c
tree97586a512b02a272d2f86d647754190a1be531ca
parent792079cf332d953eb7a9c96eec667b049e0103b2
Fix fuzzer assert in GradientShaderBase4fContext::TSampler

The arithmetic in tileProc<kMirror> may cause the result to snap to the
open interval value - which violates invariants down the line.

We need to clamp the result to nextafterf(2, 0) to ensure it stays less
than two.

BUG=skia:5913
R=reed@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2472763002

Review-Url: https://codereview.chromium.org/2472763002
src/effects/gradients/Sk4fGradientBase.cpp