aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPathRef.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-09-21 16:59:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-22 13:03:07 +0000
commitb7d42e3c11a6e1d89e8b1af030511e935ee065ba (patch)
tree384c76c4c6e10ffb692ca42da448d5b6bc363c89 /src/core/SkPathRef.cpp
parenta83b903b601a28c5e545ba307d6d6c776f1b5660 (diff)
Don't deserialize pathref oval/rrect bits
Change-Id: Id891329ee789347fb269d41bef9991f85233e031 Reviewed-on: https://skia-review.googlesource.com/49771 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core/SkPathRef.cpp')
-rw-r--r--src/core/SkPathRef.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index 4f550afa5a..68f4403b20 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -236,14 +236,6 @@ SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
ref->fIsFinite = (packed >> kIsFinite_SerializationShift) & 1;
uint8_t segmentMask = (packed >> kSegmentMask_SerializationShift) & 0xF;
- bool isOval = (packed >> kIsOval_SerializationShift) & 1;
- bool isRRect = (packed >> kIsRRect_SerializationShift) & 1;
- if (isOval && isRRect) {
- // Fuzzing generates data with both oval and rrect flags set; abort early in this case/
- return nullptr;
- }
- bool rrectOrOvalIsCCW = (packed >> kRRectOrOvalIsCCW_SerializationShift) & 1;
- unsigned rrectOrOvalStartIdx = (packed >> kRRectOrOvalStartIdx_SerializationShift) & 0x7;
int32_t verbCount, pointCount, conicCount;
if (!buffer->readU32(&(ref->fGenerationID)) ||
@@ -304,10 +296,6 @@ SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
// resetToSize clears fSegmentMask and fIsOval
ref->fSegmentMask = segmentMask;
- ref->fIsOval = isOval;
- ref->fIsRRect = isRRect;
- ref->fRRectOrOvalIsCCW = rrectOrOvalIsCCW;
- ref->fRRectOrOvalStartIdx = rrectOrOvalStartIdx;
return ref.release();
}
@@ -388,11 +376,7 @@ void SkPathRef::writeToBuffer(SkWBuffer* buffer) const {
// and fIsFinite are computed.
const SkRect& bounds = this->getBounds();
- int32_t packed = ((fRRectOrOvalStartIdx & 7) << kRRectOrOvalStartIdx_SerializationShift) |
- ((fRRectOrOvalIsCCW & 1) << kRRectOrOvalIsCCW_SerializationShift) |
- ((fIsFinite & 1) << kIsFinite_SerializationShift) |
- ((fIsOval & 1) << kIsOval_SerializationShift) |
- ((fIsRRect & 1) << kIsRRect_SerializationShift) |
+ int32_t packed = ((fIsFinite & 1) << kIsFinite_SerializationShift) |
(fSegmentMask << kSegmentMask_SerializationShift);
buffer->write32(packed);