From 93983e23c5674aa44528068030bd2c5f9bd079a7 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 30 Oct 2024 09:37:00 +0100 Subject: [PATCH] defensive check added --- src/nodes/QskBoxRenderer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nodes/QskBoxRenderer.cpp b/src/nodes/QskBoxRenderer.cpp index eadd6693..dd4afcdd 100644 --- a/src/nodes/QskBoxRenderer.cpp +++ b/src/nodes/QskBoxRenderer.cpp @@ -193,12 +193,13 @@ void QskBoxRenderer::setColoredBorderAndFillLines( const QRectF& rect, const int fillCount = stroker.fillCount(); const int borderCount = stroker.borderCount(); - auto lines = qskAllocateColoredLines( geometry, borderCount + fillCount ); + if ( auto lines = qskAllocateColoredLines( geometry, borderCount + fillCount ) ) + { + auto fillLines = fillCount ? lines : nullptr; + auto borderLines = borderCount ? lines + fillCount : nullptr; - auto fillLines = fillCount ? lines : nullptr; - auto borderLines = borderCount ? lines + fillCount : nullptr; - - stroker.setBoxLines( borderLines, fillLines ); + stroker.setBoxLines( borderLines, fillLines ); + } } else {