Fix stack overflow in d2d_cdt_triangulate if vertext_count less than 2.
Signed-off-by: Changsheng Chen chenchangsheng@uniontech.com --- dlls/d2d1/geometry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c index 6da93de3eb4..71b989fe7c1 100644 --- a/dlls/d2d1/geometry.c +++ b/dlls/d2d1/geometry.c @@ -2066,7 +2066,7 @@ static HRESULT d2d_path_geometry_triangulate(struct d2d_geometry *geometry)
cdt.free_edge = ~0u; cdt.vertices = vertices; - if (!d2d_cdt_triangulate(&cdt, 0, vertex_count, &left_edge, &right_edge)) + if (vertex_count > 1 && !d2d_cdt_triangulate(&cdt, 0, vertex_count, &left_edge, &right_edge)) goto fail; if (!d2d_cdt_insert_segments(&cdt, geometry)) goto fail;