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

Unified Diff: src/core/SkScan_AntiPath.cpp

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkFloatBits.cpp ('k') | src/core/SkScan_Antihair.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScan_AntiPath.cpp
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 6ea6b8b07ea37e78ef79e752a1e34d4ddbf8a1f6..1c222b9c80e93b836ecfc2c65b4e506e3d30b8a0 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -545,7 +545,7 @@ void MaskSuperBlitter::blitH(int x, int y, int width) {
}
#endif
- x -= (fMask.fBounds.fLeft << SHIFT);
+ x -= SkLeftShift(fMask.fBounds.fLeft, SHIFT);
// hack, until I figure out why my cubics (I think) go beyond the bounds
if (x < 0) {
@@ -592,7 +592,7 @@ static bool fitsInsideLimit(const SkRect& r, SkScalar max) {
static int overflows_short_shift(int value, int shift) {
const int s = 16 + shift;
- return (value << s >> s) - value;
+ return (SkLeftShift(value, s) >> s) - value;
}
/**
« no previous file with comments | « src/core/SkFloatBits.cpp ('k') | src/core/SkScan_Antihair.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698