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

Unified Diff: src/core/SkXfermode.cpp

Issue 596333002: Fix SkXfermode deserialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment per review. Created 6 years, 3 months 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 | « no previous file | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermode.cpp
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 443aa194055861c89c3fadf74ca3c143629bd544..8a3218fcbd0087f0d264f5550412c8a6171acf9c 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -1258,7 +1258,7 @@ SkProcCoeffXfermode::SkProcCoeffXfermode(SkReadBuffer& buffer) : INHERITED(buffe
SkFlattenable* SkProcCoeffXfermode::CreateProc(SkReadBuffer& buffer) {
uint32_t mode32 = buffer.read32();
- if (!buffer.validate(mode32 >= SK_ARRAY_COUNT(gProcCoeffs))) {
+ if (!buffer.validate(mode32 < SK_ARRAY_COUNT(gProcCoeffs))) {
return NULL;
}
return SkXfermode::Create((SkXfermode::Mode)mode32);
« no previous file with comments | « no previous file | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698