Integrating github/staging through commit ab87ed9

This commit is contained in:
alexpete
2021-04-09 11:27:37 -07:00
parent ae62a97894
commit 1044dc3da1
1582 changed files with 29374 additions and 519051 deletions
@@ -275,12 +275,21 @@ void DataWriter::ExpandBuffer(const uint32 addBytes)
const uint32 newBufferSize = m_currentBufferSize + BUFFERINCREASESIZE;
if (m_outputBuffer)
{
m_outputBuffer = realloc(m_outputBuffer, newBufferSize);
void* tmpBuffer = realloc(m_outputBuffer, newBufferSize);
AZ_Assert(
tmpBuffer != nullptr,
"realloc failed, this is possible when allocating a large data array whose size is comparable to RAM size, and also when "
"the memory is highly segmented");
if (tmpBuffer)
{
m_outputBuffer = tmpBuffer;
m_currentBufferSize = newBufferSize;
}
}
else
{
m_outputBuffer = malloc(newBufferSize);
m_currentBufferSize = newBufferSize;
}
m_currentBufferSize = newBufferSize;
}
}