skia /
skcms /
da218e6af7250a97c0ae0439695833fd4a60cdda Guard exp2f_ to never return a negative value
Certain inputs could end up returning -NaN. That would then be used as
input to eval later, and the sign-stripping wouldn't work correctly, so
we'd pass -NaN to powf_, triggering the assert.
Mathematically, exp2f_ should never return a negative value, so clamp
any underflow result to 0.
Bug: chromium:996795
Change-Id: I39072265eb2e3239590c9928df3b68cd0bfa83a3
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/290767
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
6 files changed