1
0

Fixed a buffer overflow in cChunk:SetLight().

There are only half as many bytes for light than there are blocktypes.
This commit is contained in:
madmaxoft 2014-05-02 20:56:42 +02:00
parent 92c022c140
commit 8ff7cf9262

View File

@ -380,12 +380,12 @@ void cChunk::SetLight(
{ // Compress blocklight
m_BlockLight.clear();
m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[m_BlockTypes.size()]);
m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[m_BlockTypes.size() / 2]);
}
{ // Compress skylight
m_BlockSkyLight.clear();
m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_SkyLight[0], &a_SkyLight[m_BlockTypes.size()]);
m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_SkyLight[0], &a_SkyLight[m_BlockTypes.size() / 2]);
}
m_IsLightValid = true;