Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Issue 2349153004: Harden LinearGradient4fContext (Closed)

Created:
4 years, 3 months ago by f(malita)
Modified:
4 years, 3 months ago
Reviewers:
kjlubick, reed1
CC:
reviews_skia.org
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Harden LinearGradient4fContext Three distinct issues exposed by Fuzzer: 1) truncating the flags to 8 bits may trip the assert in SkToU8 Since clients can pass in any garbage, we cannot assume it fits in 8 bits. Just static_cast<> instead. 2) vertical gradients with dx == -0.0 don't trigger interval inversion. For dx < 0 we want reversed intervals. But, alas, -0.0 < 0 == false (thanks, Ob^WIEEE 754!). Use signbit() instead. 3) half closed range checking needs to be inverted for reversed intervals. Normally we check for [p0, p1), but for reversed intervals (p1 < p0) we want to check for [p1, p0), and not (p1, p0]. Adjust the logic accordingly. BUG=skia:5647 R=reed@google.com,kjlubick@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349153004 Committed: https://skia.googlesource.com/skia/+/6d7e4e83035845e87c7972af2e7b635c0a5afbb0

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M src/effects/gradients/Sk4fLinearGradient.cpp View 3 chunks +6 lines, -4 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11 (7 generated)
f(malita)
4 years, 3 months ago (2016-09-20 01:33:49 UTC) #2
kjlubick
lgtm
4 years, 3 months ago (2016-09-20 11:43:32 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2349153004/1
4 years, 3 months ago (2016-09-20 13:54:03 UTC) #9
commit-bot: I haz the power
4 years, 3 months ago (2016-09-20 13:55:18 UTC) #11
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://skia.googlesource.com/skia/+/6d7e4e83035845e87c7972af2e7b635c0a5afbb0

Powered by Google App Engine
This is Rietveld 408576698