aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkRegion.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 080b148e47..a7e04fc8c4 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -1234,13 +1234,10 @@ static bool validate_run(const int32_t* runs,
int32_t xIntervals = *runs++;
SkASSERT(runs < end);
- if (xIntervals < 0 || runs + 1 + 2 * xIntervals > end) {
+ if (xIntervals < 0 || xIntervals > intervalCount || runs + 1 + 2 * xIntervals > end) {
return false;
}
intervalCount -= xIntervals;
- if (intervalCount < 0) {
- return false; // too many intervals
- }
bool firstInterval = true;
int32_t lastRight = 0; // check that x-intervals are distinct and ordered.
while (xIntervals-- > 0) {