Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: src/core/SkPath.cpp

Issue 2099113004: Fix mask applied to SkPath::fFillType to fix fuzzer bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <cmath> 8 #include <cmath>
9 #include "SkBuffer.h" 9 #include "SkBuffer.h"
10 #include "SkCubicClipper.h" 10 #include "SkCubicClipper.h"
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 if (!buffer.readS32(&packed)) { 2051 if (!buffer.readS32(&packed)) {
2052 return 0; 2052 return 0;
2053 } 2053 }
2054 2054
2055 unsigned version = packed & 0xFF; 2055 unsigned version = packed & 0xFF;
2056 if (version >= kPathPrivLastMoveToIndex_Version && !buffer.readS32(&fLastMov eToIndex)) { 2056 if (version >= kPathPrivLastMoveToIndex_Version && !buffer.readS32(&fLastMov eToIndex)) {
2057 return 0; 2057 return 0;
2058 } 2058 }
2059 2059
2060 fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF; 2060 fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF;
2061 fFillType = (packed >> kFillType_SerializationShift) & 0xFF; 2061 fFillType = (packed >> kFillType_SerializationShift) & 0x3;
2062 uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3; 2062 uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3;
2063 fIsVolatile = (packed >> kIsVolatile_SerializationShift) & 0x1; 2063 fIsVolatile = (packed >> kIsVolatile_SerializationShift) & 0x1;
2064 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer); 2064 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer);
2065 if (!pathRef) { 2065 if (!pathRef) {
2066 return 0; 2066 return 0;
2067 } 2067 }
2068 2068
2069 fPathRef.reset(pathRef); 2069 fPathRef.reset(pathRef);
2070 SkDEBUGCODE(this->validate();) 2070 SkDEBUGCODE(this->validate();)
2071 buffer.skipToAlign4(); 2071 buffer.skipToAlign4();
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 *direction = SkPath::kCW_Direction; 3363 *direction = SkPath::kCW_Direction;
3364 *start = firstDir; 3364 *start = firstDir;
3365 } else { 3365 } else {
3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir); 3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir);
3367 *direction = SkPath::kCCW_Direction; 3367 *direction = SkPath::kCCW_Direction;
3368 *start = secondDir; 3368 *start = secondDir;
3369 } 3369 }
3370 *rect = tempRect; 3370 *rect = tempRect;
3371 return true; 3371 return true;
3372 } 3372 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698