From a4a585d8f099c23cf15a7a4527cc53c61de94cca Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 3 Apr 2024 11:36:24 +0900 Subject: [PATCH] sw_engine/stroke: hotfix the memory access violation ensure that the number of contour/close data is properly paired. issue: https://github.com/thorvg/thorvg/issues/2129 --- src/renderer/sw_engine/tvgSwShape.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/sw_engine/tvgSwShape.cpp b/src/renderer/sw_engine/tvgSwShape.cpp index 9de61888..70cc1bf9 100644 --- a/src/renderer/sw_engine/tvgSwShape.cpp +++ b/src/renderer/sw_engine/tvgSwShape.cpp @@ -33,6 +33,7 @@ static bool _outlineBegin(SwOutline& outline) //Make a contour if lineTo/curveTo without calling close or moveTo beforehand. if (outline.pts.empty()) return false; outline.cntrs.push(outline.pts.count - 1); + outline.closed.push(false); outline.pts.push(outline.pts[outline.cntrs.last()]); outline.types.push(SW_CURVE_TYPE_POINT); return false;