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

Unified Diff: src/gpu/GrTessellatingPathRenderer.cpp

Issue 968993002: Fix for out-of-bounds intersection (found by fuzzer). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | tests/TessellatingPathRendererTests.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTessellatingPathRenderer.cpp
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index be28a69106a4a60f708bd36b70e3407e3c98e1a1..a9ae6fa4e13dee3e473c2498378a81cc9e82922e 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -958,13 +958,19 @@ void split_edge(Edge* edge, Vertex* v, Edge** activeEdges, SkChunkAlloc& alloc)
LOG("splitting edge (%g -> %g) at vertex %g (%g, %g)\n",
edge->fTop->fID, edge->fBottom->fID,
v->fID, v->fPoint.fX, v->fPoint.fY);
- Edge* newEdge = ALLOC_NEW(Edge, (v, edge->fBottom, edge->fWinding), alloc);
- insert_edge_below(newEdge, v);
- insert_edge_above(newEdge, edge->fBottom);
- set_bottom(edge, v, activeEdges);
- cleanup_active_edges(edge, activeEdges, alloc);
- fix_active_state(newEdge, activeEdges);
- merge_collinear_edges(newEdge, activeEdges);
+ if (sweep_lt(v->fPoint, edge->fTop->fPoint)) {
+ set_top(edge, v, activeEdges);
+ } else if (sweep_gt(v->fPoint, edge->fBottom->fPoint)) {
+ set_bottom(edge, v, activeEdges);
+ } else {
+ Edge* newEdge = ALLOC_NEW(Edge, (v, edge->fBottom, edge->fWinding), alloc);
+ insert_edge_below(newEdge, v);
+ insert_edge_above(newEdge, edge->fBottom);
+ set_bottom(edge, v, activeEdges);
+ cleanup_active_edges(edge, activeEdges, alloc);
+ fix_active_state(newEdge, activeEdges);
+ merge_collinear_edges(newEdge, activeEdges);
+ }
}
void merge_vertices(Vertex* src, Vertex* dst, Vertex** head, SkChunkAlloc& alloc) {
« no previous file with comments | « no previous file | tests/TessellatingPathRendererTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698