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

Unified Diff: include/core/SkImageFilter.h

Issue 83343003: Adding more validation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Attempting to upload yet again Created 7 years, 1 month 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: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 56ebc2b77b67caa55dea89c12b64245282946cee..13ffa2b03fab890ae546d120ad86959b5cac336e 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -146,6 +146,14 @@ public:
SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter)
protected:
+ // Filters either 1, 2 or N number of inputs
+ // No filter should reasonably have more than 65535 inputs
+ enum MaxInputCount {
+ kOneInput = 1,
+ kTwoInputs = 2,
+ kManyInputs = 65535,
+ };
+
SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect = NULL);
// Convenience constructor for 1-input filters.
@@ -156,7 +164,7 @@ protected:
virtual ~SkImageFilter();
- explicit SkImageFilter(SkFlattenableReadBuffer& rb);
+ explicit SkImageFilter(SkFlattenableReadBuffer& rb, int maxInputCount);
virtual void flatten(SkFlattenableWriteBuffer& wb) const SK_OVERRIDE;
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | src/core/SkBitmap.cpp » ('j') | src/effects/SkBitmapSource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698