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

Unified Diff: src/core/SkBitmapProcState_matrixProcs.cpp

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/core/SkBitmapProcState_matrixProcs.cpp
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp
index 1870a0e50e90f896a49c3d57102d426bd628612d..11d8dcf0ceec646b394cd4328a7de017e07995f2 100644
--- a/src/core/SkBitmapProcState_matrixProcs.cpp
+++ b/src/core/SkBitmapProcState_matrixProcs.cpp
@@ -176,7 +176,7 @@ static inline U16CPU fixed_repeat(SkFixed x) {
#endif
static inline U16CPU fixed_mirror(SkFixed x) {
- SkFixed s = x << 15 >> 31;
+ SkFixed s = x * (1 << 15) >> 31;
// s is FFFFFFFF if we're on an odd interval, or 0 if an even interval
return (x ^ s) & 0xFFFF;
}
« include/core/SkFixed.h ('K') | « include/core/SkFixed.h ('k') | src/core/SkEdge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698