aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-03 16:17:38 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-03 16:17:38 +0000
commit5f7c8a55eeb6c15b563166b44b86484d9b039375 (patch)
tree7768acef4037ef9e3b2bfa94056d09abd1f2c1d5 /src
parent58b8d4a7a861604474f77875e0236da271cac81c (diff)
restore extra slot in sentinal array that was removed in 3825. This extra value
is read, but not acted-upon, by spanRec.init(), and so we need to have a valid address/slot allocated. Caught by the remoting_unittests in chrome run using ASAN. Review URL: https://codereview.appspot.com/6176045 git-svn-id: http://skia.googlecode.com/svn/trunk@3830 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkRegion.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 19938c1a39..cb370cacc0 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -811,7 +811,13 @@ static int operate(const SkRegion::RunType a_runs[],
const SkRegion::RunType gEmptyScanline[] = {
0, // dummy bottom value
0, // zero intervals
- SkRegion::kRunTypeSentinel
+ SkRegion::kRunTypeSentinel,
+ // just need a 2nd value, since spanRec.init() reads 2 values, even
+ // though if the first value is the sentinel, it ignores the 2nd value.
+ // w/o the 2nd value here, we might read uninitialized memory.
+ // This happens when we are using gSentinel, which is pointing at
+ // our sentinel value.
+ 0
};
const SkRegion::RunType* const gSentinel = &gEmptyScanline[2];