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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 604873004: Fix SkTableColorFilter deserialization validation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Increase buffer size in test 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/effects/SkTableColorFilter.cpp
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 88b4a4bf4bbfe9ea366cb46bdbe2b8ed64142c3c..4853f73e5c1e7461500b4906a6d145f9275ece65 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -198,7 +198,7 @@ SkFlattenable* SkTable_ColorFilter::CreateProc(SkReadBuffer& buffer) {
uint8_t unpackedStorage[4*256];
size_t unpackedSize = SkPackBits::Unpack8(packedStorage, packedSize, unpackedStorage);
// now check that we got the size we expected
- if (!buffer.validate(unpackedSize != count*256)) {
+ if (!buffer.validate(unpackedSize == count*256)) {
return NULL;
}
« 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