You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: thirdparty/thorvg/src/renderer/sw_engine/tvgSwRle.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1025,7 +1025,7 @@ void rleFree(SwRle* rle)
1025
1025
boolrleClip(SwRle *rle, const SwRle *clip)
1026
1026
{
1027
1027
if (rle->size == 0 || clip->size == 0) returnfalse;
1028
-
auto spanCnt = rle->size > clip->size ? rle->size : clip->size;
1028
+
auto spanCnt = 2 * (rle->size > clip->size ? rle->size : clip->size); //factor 2 added for safety (no real cases observed where the factor exceeded 1.4)
1029
1029
auto spans = static_cast<SwSpan*>(malloc(sizeof(SwSpan) * (spanCnt)));
1030
1030
auto spansEnd = _intersectSpansRegion(clip, rle, spans, spanCnt);
0 commit comments