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

Side by Side Diff: src/pathops/SkIntersections.cpp

Issue 2443243002: fix a few more fuzzes (Closed)
Patch Set: Created 4 years, 1 month 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 | src/pathops/SkOpCoincidence.cpp » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 "SkIntersections.h" 8 #include "SkIntersections.h"
9 9
10 int SkIntersections::closestTo(double rangeStart, double rangeEnd, const SkDPoin t& testPt, 10 int SkIntersections::closestTo(double rangeStart, double rangeEnd, const SkDPoin t& testPt,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #if ONE_OFF_DEBUG 60 #if ONE_OFF_DEBUG
61 if (pt.roughlyEqual(fPt[index])) { 61 if (pt.roughlyEqual(fPt[index])) {
62 SkDebugf("%s t=%1.9g pts roughly equal\n", __FUNCTION__, one); 62 SkDebugf("%s t=%1.9g pts roughly equal\n", __FUNCTION__, one);
63 } 63 }
64 #endif 64 #endif
65 if (fT[0][index] > one) { 65 if (fT[0][index] > one) {
66 break; 66 break;
67 } 67 }
68 } 68 }
69 if (fUsed >= fMax) { 69 if (fUsed >= fMax) {
70 SkASSERT(0); // FIXME : this error, if it is to be handled at runtime i n release, must 70 SkOPASSERT(0); // FIXME : this error, if it is to be handled at runtime in release, must
71 // be propagated all the way back down to the caller, and return failure. 71 // be propagated all the way back down to the caller, and return failure.
72 fUsed = 0; 72 fUsed = 0;
73 return 0; 73 return 0;
74 } 74 }
75 int remaining = fUsed - index; 75 int remaining = fUsed - index;
76 if (remaining > 0) { 76 if (remaining > 0) {
77 memmove(&fPt[index + 1], &fPt[index], sizeof(fPt[0]) * remaining); 77 memmove(&fPt[index + 1], &fPt[index], sizeof(fPt[0]) * remaining);
78 memmove(&fT[0][index + 1], &fT[0][index], sizeof(fT[0][0]) * remaining); 78 memmove(&fT[0][index + 1], &fT[0][index], sizeof(fT[0][0]) * remaining);
79 memmove(&fT[1][index + 1], &fT[1][index], sizeof(fT[1][0]) * remaining); 79 memmove(&fT[1][index + 1], &fT[1][index], sizeof(fT[1][0]) * remaining);
80 int clearMask = ~((1 << index) - 1); 80 int clearMask = ~((1 << index) - 1);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 memmove(&fPt[index], &fPt[index + 1], sizeof(fPt[0]) * remaining); 152 memmove(&fPt[index], &fPt[index + 1], sizeof(fPt[0]) * remaining);
153 memmove(&fT[0][index], &fT[0][index + 1], sizeof(fT[0][0]) * remaining); 153 memmove(&fT[0][index], &fT[0][index + 1], sizeof(fT[0][0]) * remaining);
154 memmove(&fT[1][index], &fT[1][index + 1], sizeof(fT[1][0]) * remaining); 154 memmove(&fT[1][index], &fT[1][index + 1], sizeof(fT[1][0]) * remaining);
155 // SkASSERT(fIsCoincident[0] == 0); 155 // SkASSERT(fIsCoincident[0] == 0);
156 int coBit = fIsCoincident[0] & (1 << index); 156 int coBit = fIsCoincident[0] & (1 << index);
157 fIsCoincident[0] -= ((fIsCoincident[0] >> 1) & ~((1 << index) - 1)) + coBit; 157 fIsCoincident[0] -= ((fIsCoincident[0] >> 1) & ~((1 << index) - 1)) + coBit;
158 SkASSERT(!(coBit ^ (fIsCoincident[1] & (1 << index)))); 158 SkASSERT(!(coBit ^ (fIsCoincident[1] & (1 << index))));
159 fIsCoincident[1] -= ((fIsCoincident[1] >> 1) & ~((1 << index) - 1)) + coBit; 159 fIsCoincident[1] -= ((fIsCoincident[1] >> 1) & ~((1 << index) - 1)) + coBit;
160 } 160 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698