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

Ashod Nakashian ashodnakashian at yahoo.com
Tue Feb 3 01:49:06 PST 2015


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

New commits:
commit 3fffbb74d2bbd4928bd7edcfbdbb5fa650867a3d
Author: Ashod Nakashian <ashodnakashian at yahoo.com>
Date:   Mon Feb 2 14:01:30 2015 -0500

    Initialize graphics in OutputDevice::getFallbackFont.
    
    OutputDevice::getFallbackFont requires mpGraphics to be created/initialized.
    Without the check and initialization OutputDevice::getFallbackFont will segfault.
    
    Change-Id: I18225a24a6767933c8f1ff8f1cfd392543a95132
    Reviewed-on: https://gerrit.libreoffice.org/14287
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 62dcfc5..c891483 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2027,6 +2027,11 @@ SalLayout* OutputDevice::getFallbackFont(ImplFontEntry &rFallbackFont,
     FontSelectPattern &rFontSelData, int nFallbackLevel,
     ImplLayoutArgs& rLayoutArgs) const
 {
+    // we need a graphics
+    if (!mpGraphics && !AcquireGraphics())
+        return nullptr;
+
+    assert(mpGraphics != nullptr);
     rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel );
 
     rLayoutArgs.ResetPos();


More information about the Libreoffice-commits mailing list