Avoid potential crashes trying to compile 0-byte shaders

This commit is contained in:
baldurk committed 2020-06-16 15:27:39 +01:00
1 parent 9414beaed2
commit dc98283de6
1 file changed
+6
+6
View File
@@ -1854,6 +1854,9 @@ rdcpair<ResourceId, rdcstr> ReplayController::BuildTargetShader(
{
CHECK_REPLAY_THREAD();
if(source.empty())
return rdcpair<ResourceId, rdcstr>(ResourceId(), "0-byte shader is not valid");
rdcarray<ShaderEncoding> encodings = m_pDevice->GetTargetShaderEncodings();
if(encodings.indexOf(sourceEncoding) == -1)
@@ -1892,6 +1895,9 @@ rdcpair<ResourceId, rdcstr> ReplayController::BuildCustomShader(
ResourceId id;
rdcstr errs;
if(source.empty())
return rdcpair<ResourceId, rdcstr>(ResourceId(), "0-byte shader is not valid");
switch(type)
{
case ShaderStage::Vertex: