[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/win

Tor Lillqvist tml at collabora.com
Mon May 16 14:48:39 UTC 2016


 vcl/win/source/gdi/winlayout.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 081b0f19b4f665a30e2209e805aebd2f25345d70
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri May 13 09:38:38 2016 +0300

    tdf#97249: Don't crash if BindFont fails
    
    For some reason, in this branch, when OpenGL is used, the code crashes
    when attempting to display a Writer document that uses a non-scalable
    font. With this change, instead of the crash, text in such a font
    simply doesn't show up. This of course is not acceptable either, but
    better than a crash.
    
    Change-Id: I702a48fe78f2bec303aa5682dde0035275a7bb26
    Reviewed-on: https://gerrit.libreoffice.org/24946
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 4dc79ea..c693085 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -368,7 +368,12 @@ bool ImplWinFontEntry::CacheGlyphToAtlas(bool bRealGlyphIndices, int nGlyphIndex
     if (!pTxt)
         return false;
 
-    pTxt->BindFont(hDC);
+    if (!pTxt->BindFont(hDC))
+    {
+        SelectObject(hDC, hOrigFont);
+        DeleteDC(hDC);
+        return false;
+    }
 
     // Bail for non-horizontal text.
     {


More information about the Libreoffice-commits mailing list