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

Unified Diff: src/gpu/GrTessellator.cpp

Issue 2043873005: Fix for rare crash in Poly::addEdge(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Revert inadvertent changes Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTessellator.cpp
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 25d1bb3a2418e5dda1c576896faee6626a9d4052..fc09c0c649fd314639bddeda55233e2e4e1936c5 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -418,13 +418,12 @@ struct Poly {
if (!fTail) {
fHead = fTail = ALLOC_NEW(MonotonePoly, (e, side), alloc);
fCount += 2;
+ } else if (e->fBottom == fTail->fLastEdge->fBottom) {
+ return poly;
} else if (side == fTail->fSide) {
fTail->addEdge(e);
fCount++;
} else {
- if (e->fBottom == fTail->fLastEdge->fBottom) {
- return poly;
- }
e = ALLOC_NEW(Edge, (fTail->fLastEdge->fBottom, e->fBottom, 1), alloc);
fTail->addEdge(e);
fCount++;
@@ -1240,7 +1239,7 @@ Poly* tessellate(Vertex* vertices, SkChunkAlloc& alloc) {
}
if (v->fFirstEdgeBelow) {
if (!v->fFirstEdgeAbove) {
- if (leftPoly) {
+ if (leftPoly && rightPoly) {
if (leftPoly == rightPoly) {
if (leftPoly->fTail && leftPoly->fTail->fSide == Poly::kLeft_Side) {
leftPoly = new_poly(&polys, leftPoly->lastVertex(),
« 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