From ecefeeb9b79213ae306eaa84bf9391a1a1309b77 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 352e42c..3255b6c 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))); -- 2.7.4