sw_engine: adding a check before stroke fill dereference

The crash was observed for empty shapes.
This commit is contained in:
Mira Grudzinska 2021-04-14 14:45:52 +02:00 committed by Hermet Park
parent 6276e209a7
commit a13561e9c5

View file

@ -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) 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 (id == FILL_ID_LINEAR) {
if (shape->stroke->fill->translucent) return _rasterTranslucentLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill); if (shape->stroke->fill->translucent) return _rasterTranslucentLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill);