aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkValidatingReadBuffer.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-17 20:49:46 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-17 20:49:46 +0000
commitef74fa189b738e13295d6a96f86a6e10223505a8 (patch)
tree3434cb996555b725b71a520a93c8781923bc04ec /src/core/SkValidatingReadBuffer.h
parent7d0b6131918c1b8d458a95f6b5e79f92f958b78f (diff)
Fixed more fuzzer issues
- Added the "isAvailable" function to check how much bytes are remaining in the stream before doing potentially large mallocs. That way, we can signal a bad stream instead of crashing. - Added data validation in SkImageInfo.cpp - Added NULL pointer check in displacement - Modified the fuzzer for randomized bitmap types BUG=328934,329254 R=senorblanco@google.com, senorblanco@chromium.org, reed@google.com, sugoi@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/116773002 git-svn-id: http://skia.googlecode.com/svn/trunk@12723 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkValidatingReadBuffer.h')
-rw-r--r--src/core/SkValidatingReadBuffer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/SkValidatingReadBuffer.h b/src/core/SkValidatingReadBuffer.h
index febf0c0b42..627c2c42db 100644
--- a/src/core/SkValidatingReadBuffer.h
+++ b/src/core/SkValidatingReadBuffer.h
@@ -63,6 +63,8 @@ public:
virtual bool validate(bool isValid) SK_OVERRIDE;
virtual bool isValid() const SK_OVERRIDE;
+ virtual bool validateAvailable(size_t size) SK_OVERRIDE;
+
private:
bool readArray(void* value, size_t size, size_t elementSize);