From 96277576530f51cf23dafbb577870d7d4ae47c8a Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Fri, 2 Aug 2013 03:08:46 +0400 Subject: GUIFontTTFDX: prevent crash on unallocated texture or unavailable Direct3D device --- xbmc/guilib/GUIFontTTFDX.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GUIFontTTFDX.cpp b/xbmc/guilib/GUIFontTTFDX.cpp index 92c8465b6c..d6f507db2d 100644 --- a/xbmc/guilib/GUIFontTTFDX.cpp +++ b/xbmc/guilib/GUIFontTTFDX.cpp @@ -55,7 +55,10 @@ void CGUIFontTTFDX::Begin() { LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice(); - if (m_nestedBeginCount == 0) + if (pD3DDevice == NULL) + CLog::Log(LOGERROR, __FUNCTION__" - failed to get Direct3D device"); + + if (m_nestedBeginCount == 0 && pD3DDevice != NULL && m_texture != NULL) { int unit = 0; // just have to blit from our texture. -- cgit v1.2.3