mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 23:16:31 +00:00
Protect against invalid queries in GL/Vulkan
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user