From: Henri Verbeet Subject: Re: [PATCH] d2d1: Fix the stack overflow error caused by d2d_cdt_triangulate(). Message-Id: Date: Mon, 30 Aug 2021 15:09:07 +0200 In-Reply-To: References: On Mon, 30 Aug 2021 at 09:48, 陈长胜 wrote: > > When vertex_count==1 or 0, d2d_cdt_triangulate will always be called by itself, causing stack overflow error. How does it end up getting called like that, do you have a test? If I had to guess, I suppose it's possible that we end up with less than three vertices after eliminating duplicates in d2d_path_geometry_triangulate(). In that case though, it would make more sense to move the vertex count check in that function after the duplicate elimination.