Index: src/core/SkValidatingReadBuffer.h |
diff --git a/src/core/SkValidatingReadBuffer.h b/src/core/SkValidatingReadBuffer.h |
index c854b0af2c4583ddf5dac61681236bb3fd1794b4..7cbccd79e1949b237365042e490d5646d24555ab 100644 |
--- a/src/core/SkValidatingReadBuffer.h |
+++ b/src/core/SkValidatingReadBuffer.h |
@@ -47,11 +47,11 @@ public: |
virtual void readPath(SkPath* path) SK_OVERRIDE; |
// binary data and arrays |
- virtual uint32_t readByteArray(void* value) SK_OVERRIDE; |
- virtual uint32_t readColorArray(SkColor* colors) SK_OVERRIDE; |
- virtual uint32_t readIntArray(int32_t* values) SK_OVERRIDE; |
- virtual uint32_t readPointArray(SkPoint* points) SK_OVERRIDE; |
- virtual uint32_t readScalarArray(SkScalar* values) SK_OVERRIDE; |
+ virtual bool readByteArray(void* value, size_t size) SK_OVERRIDE; |
+ virtual bool readColorArray(SkColor* colors, size_t size) SK_OVERRIDE; |
+ virtual bool readIntArray(int32_t* values, size_t size) SK_OVERRIDE; |
+ virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE; |
+ virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE; |
// helpers to get info about arrays and binary data |
virtual uint32_t getArrayCount() SK_OVERRIDE; |
@@ -61,10 +61,16 @@ public: |
virtual SkTypeface* readTypeface() SK_OVERRIDE { return NULL; } |
virtual void validate(bool isValid) SK_OVERRIDE { |
reed1
2013/10/30 20:22:32
at some point, we should move all of these virtual
sugoi1
2013/10/31 14:16:24
Done.
|
- fError = fError || !isValid; |
+ if (!fError && !isValid) { |
+ // When an error is found, send the read cursor to the end of the stream |
+ fReader.skip(fReader.available()); |
+ fError = true; |
+ } |
} |
private: |
+ template <typename T> bool readArray(T* value, size_t size); |
+ |
void setMemory(const void* data, size_t size); |
static bool IsPtrAlign4(const void* ptr) { |