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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 19 08:35:29 UTC 2020


 vcl/source/outdev/font.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1441ab9c75a2f0ac664983db22b681a1b602f8a9
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Mon Oct 19 09:19:15 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 19 10:34:53 2020 +0200

    fix possible SIGSEGV
    
    after
        commit 8f54136caa786523fd224f6c98fc8e7c45cd805d
        use std::unique_ptr for SalLayout
    
    Change-Id: If1a0af9924a185694489b7f31f9e71495f2cb77b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104513
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index e5b8a9fbc1bf..f7b172c4665d 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1295,6 +1295,9 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt
         return nullptr;
     }
 
+    // keep a pointer to the layout because we might move ownership of the unique_ptr
+    const SalLayout* pSalLayoutTmp = pSalLayout.get();
+
     // prepare multi level glyph fallback
     std::unique_ptr<MultiSalLayout> pMultiSalLayout;
     ImplLayoutRuns aLayoutRuns = rLayoutArgs.maRuns;
@@ -1356,7 +1359,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt
         pSalLayout = std::move(pMultiSalLayout);
 
     // restore orig font settings
-    pSalLayout->InitFont();
+    pSalLayoutTmp->InitFont();
     rLayoutArgs.maRuns = aLayoutRuns;
 
     return pSalLayout;


More information about the Libreoffice-commits mailing list