[Libreoffice-commits] core.git: 2 commits - sd/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Jul 14 20:18:16 UTC 2018


 sd/source/filter/ppt/pptin.cxx   |    5 +++--
 sw/source/filter/ww8/ww8graf.cxx |   20 ++++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit d11313f341d1d9a9c73c736932441a89d5292e37
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 14 15:47:04 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 14 22:18:05 2018 +0200

    ofz#9116 Integer-overflow
    
    Change-Id: I8715eaee5e71341beef1c146f5eca09581f87879
    Reviewed-on: https://gerrit.libreoffice.org/57437
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a06c4bc9f182..205e25deadda 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2074,12 +2074,12 @@ SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord,
         Size aSz(pGrfNd->GetTwipSize());
         // use type <sal_uInt64> instead of sal_uLong to get correct results
         // in the following calculations.
-        sal_uInt64 rHeight = aSz.Height();
-        sal_uInt64 rWidth  = aSz.Width();
-        if( !rWidth && pF)
-            rWidth  = pF->nXaRight  - pF->nXaLeft;
-        else if( !rHeight && pF)
-            rHeight = pF->nYaBottom - pF->nYaTop;
+        sal_uInt64 nHeight = aSz.Height();
+        sal_uInt64 nWidth  = aSz.Width();
+        if (!nWidth && pF)
+            nWidth = o3tl::saturating_sub(pF->nXaRight, pF->nXaLeft);
+        else if (!nHeight && pF)
+            nHeight = o3tl::saturating_sub(pF->nYaBottom, pF->nYaTop);
 
         if( pRecord->nCropFromTop || pRecord->nCropFromBottom ||
             pRecord->nCropFromLeft || pRecord->nCropFromRight )
@@ -2088,19 +2088,19 @@ SwWW8ImplReader::SetAttributesAtGrfNode(SvxMSDffImportRec const*const pRecord,
                                         // 16.16 (fraction times total
             if( pRecord->nCropFromTop ) //        image width or height resp.)
             {
-                aCrop.SetTop(lcl_ConvertCrop(pRecord->nCropFromTop, rHeight));
+                aCrop.SetTop(lcl_ConvertCrop(pRecord->nCropFromTop, nHeight));
             }
             if( pRecord->nCropFromBottom )
             {
-                aCrop.SetBottom(lcl_ConvertCrop(pRecord->nCropFromBottom, rHeight));
+                aCrop.SetBottom(lcl_ConvertCrop(pRecord->nCropFromBottom, nHeight));
             }
             if( pRecord->nCropFromLeft )
             {
-                aCrop.SetLeft(lcl_ConvertCrop(pRecord->nCropFromLeft, rWidth));
+                aCrop.SetLeft(lcl_ConvertCrop(pRecord->nCropFromLeft, nWidth));
             }
             if( pRecord->nCropFromRight )
             {
-                aCrop.SetRight(lcl_ConvertCrop(pRecord->nCropFromRight,rWidth));
+                aCrop.SetRight(lcl_ConvertCrop(pRecord->nCropFromRight, nWidth));
             }
 
             pGrfNd->SetAttr( aCrop );
commit 3cf8c9df5d25694f170db9e95070badaaeaa371a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 14 15:42:04 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 14 22:17:55 2018 +0200

    ofz#9403 null deref
    
    Change-Id: I6efa4be9f4feb4f92f96f7030f933e4a0c406b1e
    Reviewed-on: https://gerrit.libreoffice.org/57435
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 364c07662181..f5d6a224e424 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2124,9 +2124,10 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv
                         if ( !pPtr->aTarget.isEmpty() )
                         {
                             ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
-                            if ( pDocShell )
+                            SfxMedium* pMedium = pDocShell ? pDocShell->GetMedium() : nullptr;
+                            if (pMedium)
                             {
-                                OUString aBaseURL = pDocShell->GetMedium()->GetBaseURL();
+                                OUString aBaseURL = pMedium->GetBaseURL();
                                 OUString aBookmarkURL( pInfo->GetBookmark() );
                                 INetURLObject aURL( pPtr->aTarget );
                                 if( INetProtocol::NotValid == aURL.GetProtocol()


More information about the Libreoffice-commits mailing list