Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10496)

Issue 2484041: Handle degenerate cases in SkPath::arcTo() to fix UMR's (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 1 month ago by Stephen White
Modified:
14 years ago
Reviewers:
agl
CC:
reed
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

SkPath::arcTo() will cause uninitialized memory reads in the following cases: - when the previous point in the path and (x1, y1) are coincident - when (x1, y1) and (x2, y2) are coincident These cause the setNormalize() calls to leave the "before" and "after" vectors uninitialized, respectively, which are then used to compute cosh and sinh. I chose to implement HTML5 canvas behaviour for these cases (as well as for the case where all three points are collinear): add a line to the first point, and bail. I think this is ok, since skia is mostly used for HTML5 browsers, and this case is degenerate anyway. The other option would be to return a bool here, and handle it in WebKit, but that would be a bigger change.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
src/core/SkPath.cpp View 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 3
Stephen White
14 years, 1 month ago (2010-10-13 17:27:11 UTC) #1
agl
LGTM
14 years, 1 month ago (2010-10-13 18:32:29 UTC) #2
Stephen White
14 years, 1 month ago (2010-10-13 18:47:25 UTC) #3
On 2010/10/13 18:32:29, agl wrote:
> LGTM

Committed as r603.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b