Index: src/core/SkRegion.cpp |
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp |
index 38d12d2f5d15a4e972bb3aa552e2928be9a7bce3..a50425afd8e9d4f0bb2f3601db9d332e5f47a3a8 100644 |
--- a/src/core/SkRegion.cpp |
+++ b/src/core/SkRegion.cpp |
@@ -1136,7 +1136,8 @@ size_t SkRegion::readFromMemory(const void* storage, size_t length) { |
tmp.fRunHead = SkRegion_gRectRunHeadPtr; |
} else { |
int32_t ySpanCount, intervalCount; |
- if (buffer.readS32(&ySpanCount) && buffer.readS32(&intervalCount)) { |
+ if (buffer.readS32(&ySpanCount) && buffer.readS32(&intervalCount) && |
+ intervalCount > 1) { |
tmp.allocateRuns(count, ySpanCount, intervalCount); |
buffer.read(tmp.fRunHead->writable_runs(), count * sizeof(RunType)); |
} |