[IclipMap_t] Fix incorrect plane check

This commit is contained in:
momo5502 2017-03-18 15:19:31 +01:00
parent d47cc138d5
commit 649605551d

View File

@ -681,7 +681,7 @@ namespace Assets
for (int i = 0; i < clipMap->numCBrushSides; ++i)
{
int planeIndex = reader.read<int>();
if (planeIndex < 0 || planeIndex > clipMap->numCBrushSides)
if (planeIndex < 0 || planeIndex >= clipMap->numCPlanes)
{
Components::Logger::Error("invalid plane index");
return;
@ -704,7 +704,7 @@ namespace Assets
for (int i = 0; i < clipMap->numCNodes; ++i)
{
int planeIndex = reader.read<int>();
if (planeIndex < 0 || planeIndex > clipMap->numCPlanes)
if (planeIndex < 0 || planeIndex >= clipMap->numCPlanes)
{
Components::Logger::Error("invalid plane index\n");
return;