diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 09:19:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-19 10:34:53 +0200 |
commit | 1441ab9c75a2f0ac664983db22b681a1b602f8a9 (patch) | |
tree | 831ada76d884fb8ffc1158839fa2cfd371b21dde /vcl | |
parent | 195b28c9f0cd71776d677d25e562eee8e7bef8d7 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/font.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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; |