DescriptionSkPath::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 #
MessagesTotal messages: 3
|