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

Unified Diff: src/images/SkImageDecoder_libico.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/effects/gradients/SkGradientShaderPriv.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libico.cpp
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index e8b4bc5c316cbe1b7fd587b85e5abdd672bb4f8f..cb21b6906e9bd849e039339905d122cc01ef2ca0 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -32,8 +32,8 @@ private:
//read in Intel order, and return an integer
#define readByte(buffer,begin) buffer[begin]
-#define read2Bytes(buffer,begin) buffer[begin]+(buffer[begin+1]<<8)
-#define read4Bytes(buffer,begin) buffer[begin]+(buffer[begin+1]<<8)+(buffer[begin+2]<<16)+(buffer[begin+3]<<24)
+#define read2Bytes(buffer,begin) buffer[begin]+SkLeftShift(buffer[begin+1],8)
+#define read4Bytes(buffer,begin) buffer[begin]+SkLeftShift(buffer[begin+1],8)+SkLeftShift(buffer[begin+2],16)+SkLeftShift(buffer[begin+3],24)
/////////////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/pathops/SkOpAngle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698