aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkReadBuffer.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-20 11:43:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-20 11:43:33 -0700
commit9ca06c4b00bfb9bb1a7f352efd264185e5a95fbc (patch)
tree4e0f68db60529671d9324c7768740ac3a6ca2b93 /src/core/SkReadBuffer.h
parentdf02d338be8e3c1c50b48a3a9faa582703a39c07 (diff)
Fix ImageFilter fuzzer issue
What appears to be happening in this fuzz is that a paint index inside the picture of an SkPictureImageFilter is getting changed to be out of range. BUG=skia:5192 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893423002 Review URL: https://codereview.chromium.org/1893423002
Diffstat (limited to 'src/core/SkReadBuffer.h')
-rw-r--r--src/core/SkReadBuffer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index faf853aef5..52758d05ec 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -101,6 +101,7 @@ public:
size_t offset() { return fReader.offset(); }
bool eof() { return fReader.eof(); }
virtual const void* skip(size_t size) { return fReader.skip(size); }
+
void* readFunctionPtr() { return fReader.readPtr(); }
// primitives
@@ -121,6 +122,7 @@ public:
virtual void readMatrix(SkMatrix* matrix);
virtual void readIRect(SkIRect* rect);
virtual void readRect(SkRect* rect);
+ virtual void readRRect(SkRRect* rrect);
virtual void readRegion(SkRegion* region);
virtual void readPath(SkPath* path);
@@ -203,9 +205,12 @@ public:
}
// Default impelementations don't check anything.
- virtual bool validate(bool isValid) { return true; }
+ virtual bool validate(bool isValid) { return isValid; }
virtual bool isValid() const { return true; }
virtual bool validateAvailable(size_t size) { return true; }
+ bool validateIndex(int index, int count) {
+ return this->validate(index >= 0 && index < count);
+ }
protected:
SkReader32 fReader;