diff --git a/src/renderer/sw_engine/tvgSwFill.cpp b/src/renderer/sw_engine/tvgSwFill.cpp index 9978baf9..8715ca13 100644 --- a/src/renderer/sw_engine/tvgSwFill.cpp +++ b/src/renderer/sw_engine/tvgSwFill.cpp @@ -308,6 +308,7 @@ static inline uint32_t _fixedPixel(const SwFill* fill, int32_t pos) static inline uint32_t _pixel(const SwFill* fill, float pos) { + if (!std::isfinite(pos)) pos = 0; auto i = static_cast(pos * (GRADIENT_STOP_SIZE - 1) + 0.5f); return fill->ctable[_clamp(fill, i)]; }