diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-13 17:22:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-13 22:14:04 +0200 |
commit | 364b559e2e090824d304e816827e12ba34539994 (patch) | |
tree | 6177947b3bf3dc23f921ae4dc73b504132806476 /drawinglayer | |
parent | 515006ff9a8977b184e806a70eb4d8f3a318886f (diff) |
ofz: Null-deference
Change-Id: I339cfb54379b1c98a04747046ed599a23d49c220
Reviewed-on: https://gerrit.libreoffice.org/58949
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index ebbcc2f3f5a7..72674e6c4a1a 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -1666,8 +1666,13 @@ namespace emfplushelper SAL_INFO("drawinglayer", "EMF+ SetClipPath combine mode: " << combineMode); SAL_INFO("drawinglayer", "EMF+\tpath in slot: " << (flags & 0xff)); - EMFPPath& path = *static_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get()); - ::basegfx::B2DPolyPolygon& clipPoly(path.GetPolygon(*this)); + EMFPPath *path = static_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get()); + if (!path) + { + break; + } + + ::basegfx::B2DPolyPolygon& clipPoly(path->GetPolygon(*this)); // clipPoly.transform(rState.mapModeTransform); HandleNewClipRegion( combineClip(mrPropertyHolders.Current().getClipPolyPolygon(), combineMode, clipPoly), mrTargetHolders, mrPropertyHolders); @@ -1679,6 +1684,10 @@ namespace emfplushelper SAL_INFO("drawinglayer", "EMF+ SetClipRegion"); SAL_INFO("drawinglayer", "EMF+\tregion in slot: " << (flags & 0xff) << " combine mode: " << combineMode); EMFPRegion *region = static_cast<EMFPRegion*>(maEMFPObjects[flags & 0xff].get()); + if (!region) + { + break; + } HandleNewClipRegion(combineClip(mrPropertyHolders.Current().getClipPolyPolygon(), combineMode, region->regionPolyPolygon), mrTargetHolders, mrPropertyHolders); break; |