Protect against invalid queries in GL/Vulkan

This commit is contained in:
baldurk
2020-10-13 21:31:16 +01:00
parent bf4d68fb03
commit 8af614fa71
2 changed files with 14 additions and 1 deletions
+8
View File
@@ -339,6 +339,7 @@ void GLReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, byt
if(m_pDriver->m_Buffers.find(buff) == m_pDriver->m_Buffers.end())
{
RDCWARN("Requesting data for non-existant buffer %s", ToStr(buff).c_str());
ret.clear();
return;
}
@@ -2354,6 +2355,13 @@ void GLReplay::GetTextureData(ResourceId tex, const Subresource &sub,
{
WrappedOpenGL &drv = *m_pDriver;
if(m_pDriver->m_Textures.find(tex) == m_pDriver->m_Textures.end())
{
data.clear();
RDCWARN("Requesting data for non-existant texture %s", ToStr(tex).c_str());
return;
}
WrappedOpenGL::TextureData &texDetails = m_pDriver->m_Textures[tex];
GLuint tempTex = 0;
+6 -1
View File
@@ -1609,11 +1609,16 @@ void VulkanDebugManager::GetBufferData(ResourceId buff, uint64_t offset, uint64_
return;
}
}
else
else if(WrappedVkBuffer::IsAlloc(res))
{
srcBuf = m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(buff);
bufsize = m_pDriver->m_CreationInfo.m_Buffer[buff].size;
}
else
{
RDCERR("Getting buffer data for object that isn't buffer or memory %s!", ToStr(buff).c_str());
return;
}
if(offset >= bufsize)
{