Don't fetch buffer data if it's not yet initialised

This commit is contained in:
baldurk
2020-10-02 12:53:38 +01:00
parent eeb0469057
commit e1d025e4ef
+2 -1
View File
@@ -2563,7 +2563,8 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
uint64_t unclampedLen = m_ByteSize;
if(unclampedLen == UINT64_MAX)
{
uint64_t bufLen = m_IsBuffer ? m_Ctx.GetBuffer(m_BufferID)->length : 0;
uint64_t bufLen =
m_IsBuffer && m_BufferID != ResourceId() ? m_Ctx.GetBuffer(m_BufferID)->length : 0;
uint64_t bufOffs = m_ByteOffset;
if(bufOffs >= bufLen)