[Libreoffice-commits] core.git: drawinglayer/source

Caolán McNamara caolanm at redhat.com
Mon Mar 26 15:55:39 UTC 2018


 drawinglayer/source/tools/emfphelperdata.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 2634200a15c42e45edcaaaeac81243c67ded3ad1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 26 12:14:23 2018 +0100

    forcepoint #32 survive missing emf paths
    
    Change-Id: Ic27c3bbac12f66b30ff2f30f558180127cc73a51
    Reviewed-on: https://gerrit.libreoffice.org/51873
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index a5dda5d2ad96..09c3a2854aab 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -938,7 +938,11 @@ namespace emfplushelper
                         rMS.ReadUInt32(brushIndexOrColor);
                         SAL_INFO("drawinglayer", "EMF+ FillPath slot: " << index);
 
-                        EMFPPlusFillPolygon(static_cast<EMFPPath*>(maEMFPObjects[index].get())->GetPolygon(*this), flags & 0x8000, brushIndexOrColor);
+                        EMFPPath* path = static_cast<EMFPPath*>(maEMFPObjects[index].get());
+                        if (path)
+                            EMFPPlusFillPolygon(path->GetPolygon(*this), flags & 0x8000, brushIndexOrColor);
+                        else
+                            SAL_WARN("drawinglayer", "EmfPlusRecordTypeFillPath missing path");
                     }
                     break;
                     case EmfPlusRecordTypeFillRegion:
@@ -1061,10 +1065,12 @@ namespace emfplushelper
                         rMS.ReadUInt32(penIndex);
                         SAL_INFO("drawinglayer", "EMF+ DrawPath");
                         SAL_INFO("drawinglayer", "EMF+\tpen: " << penIndex);
-                        EMFPPath* path = static_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get());
-                        SAL_WARN_IF(!path, "drawinglayer", "EmfPlusRecordTypeDrawPath missing path");
 
-                        EMFPPlusDrawPolygon(path->GetPolygon(*this), penIndex);
+                        EMFPPath* path = static_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get());
+                        if (path)
+                            EMFPPlusDrawPolygon(path->GetPolygon(*this), penIndex);
+                        else
+                            SAL_WARN("drawinglayer", "EmfPlusRecordTypeDrawPath missing path");
 
                         break;
                     }


More information about the Libreoffice-commits mailing list