[skottie] Suppress ubsan div-by-zero VenetialBlindsAdapter crash
It's fine to allow -/+ inf because we immediately clamp to 0/1. Fixed: oss-fuzz:15927 Change-Id: Ic9c866e78c9b79ea2055d2dbf403c26b29031622 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284481 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
607a489345
commit
24ea293cd2
@ -112,8 +112,9 @@ private:
|
||||
|
||||
// Gradient value at fp0/fp1, fp2/fp3.
|
||||
// Note: g01 > 0 iff fp0-fp1 is collapsed and g23 < 1 iff fp2-fp3 is collapsed
|
||||
const auto g01 = std::max(0.0f, 0.5f * (1 + (0 - t) / df)),
|
||||
g23 = std::min(1.0f, 0.5f * (1 + (1 - t) / df));
|
||||
const auto g01 = std::max(0.0f, 0.5f * (1 + sk_ieee_float_divide(0 - t, df))),
|
||||
g23 = std::min(1.0f, 0.5f * (1 + sk_ieee_float_divide(1 - t, df)));
|
||||
SkASSERT(0 <= g01 && g01 <= g23 && g23 <= 1);
|
||||
|
||||
const SkColor c01 = SkColorSetA(SK_ColorWHITE, SkScalarRoundToInt(g01 * 0xff)),
|
||||
c23 = SkColorSetA(SK_ColorWHITE, SkScalarRoundToInt(g23 * 0xff)),
|
||||
|
Loading…
Reference in New Issue
Block a user