diff options
author | Anton Fedchin <anightik@gmail.com> | 2016-10-20 17:53:51 +0300 |
---|---|---|
committer | Anton Fedchin <anightik@gmail.com> | 2016-10-20 17:55:55 +0300 |
commit | 05b5ee05b7057134d31032903867893ec59e2ee6 (patch) | |
tree | 56e88660dff1ef62d7fa1af0f5f85b6f4fb3739e | |
parent | 2e09226e5878ab2990afd71051d7c0d6dd31ccb8 (diff) |
win32: GUIFontTTFDX: added check on safety to not update resource if it's not exist.
-rw-r--r-- | xbmc/guilib/GUIFontTTFDX.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xbmc/guilib/GUIFontTTFDX.cpp b/xbmc/guilib/GUIFontTTFDX.cpp index 144c2dced9..f87abf74f0 100644 --- a/xbmc/guilib/GUIFontTTFDX.cpp +++ b/xbmc/guilib/GUIFontTTFDX.cpp @@ -263,15 +263,14 @@ bool CGUIFontTTFDX::CopyCharToTexture(FT_BitmapGlyph bitGlyph, unsigned int x1, FT_Bitmap bitmap = bitGlyph->bitmap; ID3D11DeviceContext* pContext = g_Windowing.GetImmediateContext(); - if (m_speedupTexture && pContext) + if (m_speedupTexture && m_speedupTexture->Get() && pContext && bitmap.buffer) { CD3D11_BOX dstBox(x1, y1, 0, x2, y2, 1); pContext->UpdateSubresource(m_speedupTexture->Get(), 0, &dstBox, bitmap.buffer, bitmap.pitch, 0); + return true; } - else - return false; - return TRUE; + return false; } void CGUIFontTTFDX::DeleteHardwareTexture() |