diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-02-02 14:01:30 -0500 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-03 09:48:43 +0000 |
commit | 3fffbb74d2bbd4928bd7edcfbdbb5fa650867a3d (patch) | |
tree | 364e6718d539ea1acdb380efa3de9c4c6037b9b9 /vcl | |
parent | 343a23058e080c28088a97bf22e444160aa2030e (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/font.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 62dcfc59f60a..c891483c208e 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(); |