D3D: Fix crash if shaders fail to compile

This commit is contained in:
Stenzek
2017-09-07 11:45:43 +10:00
parent c97a799c5f
commit c15ea2f1ed
2 changed files with 3 additions and 3 deletions

View File

@ -251,7 +251,7 @@ bool GeometryShaderCache::CompileShader(const GeometryShaderUid& uid)
ShaderCode code =
GenerateGeometryShaderCode(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
if (!D3D::CompileGeometryShader(code.GetBuffer(), &bytecode) ||
!InsertByteCode(uid, bytecode->Data(), bytecode->Size()))
!InsertByteCode(uid, bytecode ? bytecode->Data() : nullptr, bytecode ? bytecode->Size() : 0))
{
SAFE_RELEASE(bytecode);
return false;