sw_engine rle: fixing clipping with non overlaping figures
authorMira Grudzinska <m.grudzinska@samsung.com>
Sat, 6 Feb 2021 23:01:49 +0000 (00:01 +0100)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 19 Feb 2021 08:34:54 +0000 (17:34 +0900)
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

index 352e42c..3255b6c 100644 (file)
@@ -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<SwSpan*>(realloc(rle->spans, rle->size * sizeof(SwSpan)));