slideshow/source/engine/slideshowimpl.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit 64121a303b5ceb3dd149215529ef8346b6d00dcd Author: Regina Henschel <rb.hensc...@t-online.de> AuthorDate: Tue Aug 15 01:09:25 2023 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Aug 15 09:52:30 2023 +0200 CID 1539919: Null pointer dereferences The problem was introduced in 631964a2ce1da3fbbeb53a5550c0e6728ba644aa tfd#112687 Combine adjacent lines into one shape Change-Id: I4c064a22e5fcc0040e249dbde09ee591ac2693c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155686 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 33a9825e544a..81661fab215a 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1445,14 +1445,16 @@ void lcl_setPropertiesToShape(const drawing::PointSequenceSequence& rPoints, aXPropSet->setPropertyValue("LineCap", uno::Any(eLC)); //LineColor - sal_uInt32 nLineColor; - nLineColor = pCanvasPolyPoly->getRGBALineColor(); + sal_uInt32 nLineColor = 0; + if (pCanvasPolyPoly) + nLineColor = pCanvasPolyPoly->getRGBALineColor(); //Transform polygon color from RRGGBBAA to AARRGGBB aXPropSet->setPropertyValue("LineColor", uno::Any(RGBAColor2UnoColor(nLineColor))); //LineWidth - double fLineWidth; - fLineWidth = pCanvasPolyPoly->getStrokeWidth(); + double fLineWidth = 0; + if (pCanvasPolyPoly) + fLineWidth = pCanvasPolyPoly->getStrokeWidth(); aXPropSet->setPropertyValue("LineWidth", uno::Any(static_cast<sal_Int32>(fLineWidth))); } @@ -1509,7 +1511,7 @@ void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMult // We collect these points into one B2DPolygon and use that to generate the shape on the // slide. ::basegfx::B2DPolygon aDrawingPoints; - cppcanvas::PolyPolygonSharedPtr pFirstPolyPoly; // for style properties + cppcanvas::PolyPolygonSharedPtr pFirstPolyPoly = aPolygons.front(); // for style properties for( const auto& pPolyPoly : aPolygons ) { // Actually, each item in aPolygons has two points, but wrapped in a cppcanvas::PopyPolygon.