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

Unified Diff: src/core/SkImageFilter.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify xfermodes, fix SkLayerDrawLooper Created 6 years, 4 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
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 4a9a22e63445bde4b0c6705403fe0dc08ee31805..4f2251eee186bd5f2018599eafa445b9d27d47ca 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -75,9 +75,9 @@ void SkImageFilter::Common::detachInputs(SkImageFilter** inputs) {
}
bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) {
- int count = buffer.readInt();
- if (expectedCount < 0) { // means the caller doesn't care how many
- expectedCount = count;
+ const int count = buffer.readInt();
+ if (!buffer.validate(count >= 0)) {
sugoi1 2014/08/19 18:46:16 If it is no longer possible to use an expectedCoun
reed1 2014/08/19 19:58:05 Good catch, I think I no longer take -1.
+ return false;
}
if (!buffer.validate((count == expectedCount) && (count >= 0))) {
return false;

Powered by Google App Engine
This is Rietveld 408576698