From 07e6c476a85373abd8307804b5f1f3acbe2a5b8d Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Thu, 25 Feb 2021 23:43:26 +0100 Subject: [PATCH] sw_engine fill: fixing the infinite loop condition Fixed in the fillFetchLinear() function. --- src/lib/sw_engine/tvgSwFill.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/sw_engine/tvgSwFill.cpp b/src/lib/sw_engine/tvgSwFill.cpp index 882f3b7b..676cd6eb 100644 --- a/src/lib/sw_engine/tvgSwFill.cpp +++ b/src/lib/sw_engine/tvgSwFill.cpp @@ -257,7 +257,8 @@ void fillFetchLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, } //we have to fallback to float math } else { - while (dst < dst + len) { + uint32_t counter = 0; + while (counter++ < len) { *dst = _pixel(fill, t / GRADIENT_STOP_SIZE); ++dst; t += inc;