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

Unified Diff: src/core/SkPath.cpp

Issue 1589533002: Fix fuzzer-found deserialization bugs (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Also prevent overflow in SkBufferWithSizeCheck::read Created 4 years, 11 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/SkPaint.cpp ('k') | src/core/SkPathRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index ab8d7359d2271b5a15b531859f44379522a4b378..a9989234bd988ea937bcb48a29dc167dbbf8a01b 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1930,7 +1930,7 @@ size_t SkPath::readFromMemory(const void* storage, size_t length) {
}
size_t sizeRead = 0;
- if (buffer.isValid()) {
+ if (buffer.isValid() && pathRef) {
reed1 2016/01/13 19:20:05 I think this if/else-if is getting more confusing.
ajuma 2016/01/13 20:08:15 Moved the check. The suggested SkASSERT doesn't ho
fPathRef.reset(pathRef);
SkDEBUGCODE(this->validate();)
buffer.skipToAlign4();
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPathRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698