Fix crash when shader cache file is empty

This commit is contained in:
2022-08-14 22:47:32 +03:00
parent bdea0930da
commit 54e30c35e9

View File

@@ -113,6 +113,11 @@ bool ShaderAssetBase::Save()
bool IsValidShaderCache(DataContainer<byte>& shaderCache, Array<String>& includes)
{
if (shaderCache.Length() == 0)
{
return false;
}
MemoryReadStream stream(shaderCache.Get(), shaderCache.Length());
// Read cache format version