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

Unified Diff: include/core/SkRegion.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/SkRegion.h
diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h
index a088d546200be5211aff976fddc2118a1b392af1..c3aa327a00af34c78948bd9dac6a29ff6c297049 100644
--- a/include/core/SkRegion.h
+++ b/include/core/SkRegion.h
@@ -12,6 +12,7 @@
#include "SkRect.h"
+class SkFlattenableReadBuffer;
class SkPath;
class SkRgnBuilder;
@@ -358,6 +359,14 @@ public:
};
/**
+ * 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);
+ /**
* 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