mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-23 06:08:19 +00:00
fix when pData isn't a null terminated string.
This commit is contained in:
1 parent
a0d84d0daa
commit
31104c817a
1 file changed
+12
-1
@@ -300,7 +300,18 @@ public:
|
||||
return m_pDevice->SetShaderDebugPath(this, (const char *)pData);
|
||||
|
||||
if(guid == WKPDID_D3DDebugObjectName)
|
||||
m_pDevice->SetResourceName(this, (const char *)pData);
|
||||
{
|
||||
const char *pStrData = (const char *)pData;
|
||||
if(DataSize != 0 && pStrData[DataSize - 1] != '\0')
|
||||
{
|
||||
string sName(pStrData, DataSize);
|
||||
m_pDevice->SetResourceName(this, sName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pDevice->SetResourceName(this, pStrData);
|
||||
}
|
||||
}
|
||||
|
||||
return m_pReal->SetPrivateData(guid, DataSize, pData);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user