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

Unified Diff: src/core/SkValidatingReadBuffer.cpp

Issue 116773002: Fixed more fuzzer issues (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years 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: src/core/SkValidatingReadBuffer.cpp
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp
index 692d0dd4d18c83b0f7f5bd13e0bc229ba478253a..4ef1c2c01306d43148d5374b1fd96cc806d5c3df 100644
--- a/src/core/SkValidatingReadBuffer.cpp
+++ b/src/core/SkValidatingReadBuffer.cpp
@@ -228,6 +228,10 @@ SkTypeface* SkValidatingReadBuffer::readTypeface() {
return NULL;
}
+bool SkValidatingReadBuffer::isAvailable(size_t size) const {
+ return (size <= SK_MaxU32) && fReader.isAvailable(static_cast<uint32_t>(size));
+}
+
SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type type) {
SkString name;
this->readString(&name);

Powered by Google App Engine
This is Rietveld 408576698