| Index: Source/core/html/canvas/CanvasPathMethods.cpp
|
| diff --git a/Source/core/html/canvas/CanvasPathMethods.cpp b/Source/core/html/canvas/CanvasPathMethods.cpp
|
| index 85a13a49e65878d060ad0f58e72d77facd684638..3d9ccd2ab2e584e04a50fc0260d2c36876737e73 100644
|
| --- a/Source/core/html/canvas/CanvasPathMethods.cpp
|
| +++ b/Source/core/html/canvas/CanvasPathMethods.cpp
|
| @@ -180,8 +180,14 @@ void canonicalizeAngle(float* startAngle, float* endAngle)
|
| {
|
| // Make 0 <= startAngle < 2*PI
|
| float newStartAngle = fmodf(*startAngle, twoPiFloat);
|
| - if (newStartAngle < 0)
|
| +
|
| + if (newStartAngle < 0) {
|
| newStartAngle += twoPiFloat;
|
| + // Check for possible catastrophic cancellation in cases where
|
| + // newStartAngle was a tiny negative number (c.f. crbug.com/503422)
|
| + if (newStartAngle >= twoPiFloat)
|
| + newStartAngle -= twoPiFloat;
|
| + }
|
|
|
| float delta = newStartAngle - *startAngle;
|
| *startAngle = newStartAngle;
|
|
|