vcl/win/source/gdi/winlayout.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 081b0f19b4f665a30e2209e805aebd2f25345d70 Author: Tor Lillqvist <t...@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 <c...@libreoffice.org> Reviewed-by: Michael Meeks <michael.me...@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. { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits