diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkScan_Path.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp index 211259fcf7..636478dc3a 100644 --- a/src/core/SkScan_Path.cpp +++ b/src/core/SkScan_Path.cpp @@ -383,7 +383,11 @@ extern "C" { valuea = edgea->fX; valueb = edgeb->fX; } - return valuea - valueb; + + // this overflows if valuea >>> valueb or vice-versa + // return valuea - valueb; + // do perform the slower but safe compares + return (valuea < valueb) ? -1 : (valuea > valueb); } } |