From a13561e9c514f6acc412dc5c6333ac8b0e14cd2c Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Wed, 14 Apr 2021 14:45:52 +0200 Subject: [PATCH] sw_engine: adding a check before stroke fill dereference The crash was observed for empty shapes. --- src/lib/sw_engine/tvgSwRaster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/sw_engine/tvgSwRaster.cpp b/src/lib/sw_engine/tvgSwRaster.cpp index b1174129..f5cb6c94 100644 --- a/src/lib/sw_engine/tvgSwRaster.cpp +++ b/src/lib/sw_engine/tvgSwRaster.cpp @@ -1033,7 +1033,7 @@ bool rasterStroke(SwSurface* surface, SwShape* shape, uint8_t r, uint8_t g, uint bool rasterGradientStroke(SwSurface* surface, SwShape* shape, unsigned id) { - if (!shape->stroke->fill || !shape->strokeRle) return false; + if (!shape->stroke || !shape->stroke->fill || !shape->strokeRle) return false; if (id == FILL_ID_LINEAR) { if (shape->stroke->fill->translucent) return _rasterTranslucentLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill);