From 29ca149b4bc44347049efa86615396d0de9a7408 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Sun, 7 Feb 2021 00:01:49 +0100 Subject: [PATCH] sw_engine rle: fixing clipping with non overlaping figures For clip that did not overlap with the plotted source, the whole source was plotted - the size of the rle data was not updated. --- src/lib/sw_engine/tvgSwRle.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/sw_engine/tvgSwRle.cpp b/src/lib/sw_engine/tvgSwRle.cpp index 352e42c2..3255b6cc 100644 --- a/src/lib/sw_engine/tvgSwRle.cpp +++ b/src/lib/sw_engine/tvgSwRle.cpp @@ -917,7 +917,12 @@ void rleFree(SwRleData* rle) void updateRleSpans(SwRleData *rle, SwSpan* curSpans, uint32_t size) { - if (!rle->spans || !curSpans || size == 0) return; + if (size == 0) { + rle->size = 0; + return; + } + + if (!rle->spans || !curSpans) return; rle->size = size; rle->spans = static_cast(realloc(rle->spans, rle->size * sizeof(SwSpan)));