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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 1235163002: Remove unused PackBits methods and fix length checks (Closed) Base URL: https://skia.googlesource.com/skia.git@m44
Patch Set: Created 5 years, 5 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 | « src/core/SkPackBits.cpp ('k') | tests/PackBitsTest.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 7298960a08618b05f5136c80bf6577e0fdfe63e0..8e54a014779c4ff305f937c0c4b940551a2f78d9 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -201,8 +201,8 @@ static const uint8_t gCountNibBits[] = {
void SkTable_ColorFilter::flatten(SkWriteBuffer& buffer) const {
uint8_t storage[5*256];
int count = gCountNibBits[fFlags & 0xF];
- size_t size = SkPackBits::Pack8(fStorage, count * 256, storage);
- SkASSERT(size <= sizeof(storage));
+ size_t size = SkPackBits::Pack8(fStorage, count * 256, storage,
+ sizeof(storage));
buffer.write32(fFlags);
buffer.writeByteArray(storage, size);
@@ -223,7 +223,8 @@ SkFlattenable* SkTable_ColorFilter::CreateProc(SkReadBuffer& buffer) {
}
uint8_t unpackedStorage[4*256];
- size_t unpackedSize = SkPackBits::Unpack8(packedStorage, packedSize, unpackedStorage);
+ size_t unpackedSize = SkPackBits::Unpack8(packedStorage, packedSize,
+ unpackedStorage, sizeof(unpackedStorage));
// now check that we got the size we expected
if (!buffer.validate(unpackedSize == count*256)) {
return NULL;
« no previous file with comments | « src/core/SkPackBits.cpp ('k') | tests/PackBitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698