Index: src/core/SkValidatingReadBuffer.cpp |
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp |
index a92c1b9b6fb7d527584661676d9e61f04d9a11fc..4a8ac472472fcbd0edcc77a1d4021ac164df5c9b 100644 |
--- a/src/core/SkValidatingReadBuffer.cpp |
+++ b/src/core/SkValidatingReadBuffer.cpp |
@@ -203,7 +203,7 @@ bool SkValidatingReadBuffer::readScalarArray(SkScalar* values, size_t size) { |
uint32_t SkValidatingReadBuffer::getArrayCount() { |
const size_t inc = sizeof(uint32_t); |
fError = fError || !IsPtrAlign4(fReader.peek()) || !fReader.isAvailable(inc); |
- return *(uint32_t*)fReader.peek(); |
+ return fError ? 0 : *(uint32_t*)fReader.peek(); |
} |
void SkValidatingReadBuffer::readBitmap(SkBitmap* bitmap) { |