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

Issue 2165013002: limit the number of points in SkDashPathEffect::asPoints (Closed)

Created:
4 years, 5 months ago by lsalzman1
Modified:
4 years, 5 months ago
Reviewers:
caryclark, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

limit the number of points in SkDashPathEffect::asPoints If the length of a line path is sufficiently long relative to the dash interval, it is possible to cause SkDashPathEffect::asPoints to produce so many points that it overflows the amount that can fit in an int type, or otherwise produce non-finite values, i.e. path from (0,0) to (0,9e15) with a dash interval of 1. This fixes that by capping the amount of points to a sane limit - in this case, 1mil, since that limit is also used in utils/SkDashPath.cpp and has precedent. Downstream Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1287515 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165013002 Committed: https://skia.googlesource.com/skia/+/f41ae2f9738e32a43762b780e6d113b4b6157747

Patch Set 1 #

Total comments: 1

Patch Set 2 : factor out kMaxDashCount and add unit test #

Patch Set 3 : fix SpecialLineRec point count overflow #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M src/effects/SkDashPathEffect.cpp View 1 1 chunk +8 lines, -1 line 0 comments Download
M src/utils/SkDashPath.cpp View 1 2 2 chunks +1 line, -1 line 1 comment Download
M src/utils/SkDashPathPriv.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tests/DashPathEffectTest.cpp View 1 2 chunks +16 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
lsalzman1
4 years, 5 months ago (2016-07-20 17:55:01 UTC) #3
reed1
https://codereview.chromium.org/2165013002/diff/1/src/effects/SkDashPathEffect.cpp File src/effects/SkDashPathEffect.cpp (right): https://codereview.chromium.org/2165013002/diff/1/src/effects/SkDashPathEffect.cpp#newcode251 src/effects/SkDashPathEffect.cpp:251: // Too many midpoints can cause results->fNumPoints to overflow ...
4 years, 5 months ago (2016-07-20 18:06:15 UTC) #5
lsalzman1
On 2016/07/20 18:06:15, reed1 wrote: > https://codereview.chromium.org/2165013002/diff/1/src/effects/SkDashPathEffect.cpp > File src/effects/SkDashPathEffect.cpp (right): > > https://codereview.chromium.org/2165013002/diff/1/src/effects/SkDashPathEffect.cpp#newcode251 > ...
4 years, 5 months ago (2016-07-20 18:11:43 UTC) #6
reed1
Doh! You're right. I thought (dumbly) you were just clamping the count. My bad. I ...
4 years, 5 months ago (2016-07-20 18:29:39 UTC) #7
caryclark
Two requests: Can you move kMaxDashCount into SkDashPath so that both SkDashPath::InternalFilter and SkDashPathEffect::asPoints can ...
4 years, 5 months ago (2016-07-20 19:35:33 UTC) #8
lsalzman1
On 2016/07/20 19:35:33, caryclark wrote: > Two requests: > Can you move kMaxDashCount into SkDashPath ...
4 years, 5 months ago (2016-07-21 03:22:48 UTC) #9
caryclark
Thanks for the test. With comment addressed, LGTM https://codereview.chromium.org/2165013002/diff/40001/src/utils/SkDashPath.cpp File src/utils/SkDashPath.cpp (right): https://codereview.chromium.org/2165013002/diff/40001/src/utils/SkDashPath.cpp#newcode179 src/utils/SkDashPath.cpp:179: ptCount ...
4 years, 5 months ago (2016-07-21 12:22:59 UTC) #10
lsalzman1
On 2016/07/21 12:22:59, caryclark wrote: > Thanks for the test. With comment addressed, LGTM > ...
4 years, 5 months ago (2016-07-21 12:33:53 UTC) #11
caryclark
On 2016/07/21 12:33:53, lsalzman1 wrote: > On 2016/07/21 12:22:59, caryclark wrote: > > Thanks for ...
4 years, 5 months ago (2016-07-21 12:36:35 UTC) #12
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/2165013002/40001
4 years, 5 months ago (2016-07-21 16:21:49 UTC) #14
commit-bot: I haz the power
4 years, 5 months ago (2016-07-21 16:38:02 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/f41ae2f9738e32a43762b780e6d113b4b6157747

Powered by Google App Engine
This is Rietveld 408576698