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

Unified Diff: src/core/SkReadBuffer.h

Issue 1893423002: Fix ImageFilter fuzzer issue (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove setOffset Created 4 years, 8 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
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkReadBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkReadBuffer.h
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index faf853aef5430124c7f916636804c88fa6eb4df1..52758d05ec3ce94cde48d0499f5739243688e3b9 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;
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698