summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-06 20:14:46 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-06 20:14:46 +0000
commitf893579057ec9cf6c968c5eccd0f5131d4596056 (patch)
treebcfaa668095715514b95ed71291a744fb216863e
parent6d947d023573f50caf71a5eef96e3fbca0d2a130 (diff)
downloadinclude-f893579057ec9cf6c968c5eccd0f5131d4596056.tar.gz
Fixed a few places where uninitialized memory could have been read
Also added early exit in SkImageFilter's constructor to avoid attempting to deserialize all inputs once a bad input has been found. This avoids hanging if a filter pretends to have 1 billion inputs when that's just an error on the number of inputs read by the filter. BUG=326206,326197,326229 R=senorblanco@chromium.org, senorblanco@google.com, reed@google.com, sugoi@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/106943002 git-svn-id: http://skia.googlecode.com/svn/trunk/include@12544 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--core/SkFlattenableBuffers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/SkFlattenableBuffers.h b/core/SkFlattenableBuffers.h
index 575dec8..00cb77a 100644
--- a/core/SkFlattenableBuffers.h
+++ b/core/SkFlattenableBuffers.h
@@ -154,6 +154,12 @@ public:
*/
virtual bool validate(bool isValid);
+ /** This function returns true by default
+ * If isValidating() is true, it will return false if the internal error flag is set.
+ * Otherwise, it will return true.
+ */
+ virtual bool isValid() const { return true; }
+
private:
template <typename T> T* readFlattenableT();
uint32_t fFlags;