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

Unified Diff: include/core/SkPath.h

Issue 41253002: Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index a6674d9afb4e65cc024ee8a155d5f4f4b4869bfe..eb0846be903ac8b97145fc705332ff1eaf18fdb3 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -27,6 +27,7 @@
class SkReader32;
class SkWriter32;
class SkAutoPathBoundsUpdate;
+class SkFlattenableReadBuffer;
class SkString;
class SkRRect;
@@ -910,6 +911,14 @@ public:
void dump() const;
/**
+ * Returns the number of bytes of the current object's flattened representation.
+ */
+ uint32_t sizeInMemory() const;
+ /**
+ * Returns the number of bytes to read.
+ */
+ static uint32_t SizeToRead(SkFlattenableReadBuffer& buffer);
reed1 2013/10/24 20:51:19 :( Do we really need to teach SkPath about readbuf
+ /**
* Write the region to the buffer, and return the number of bytes written.
* If buffer is NULL, it still returns the number of bytes.
*/

Powered by Google App Engine
This is Rietveld 408576698