aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/SynchedEntityData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/SynchedEntityData.cpp')
-rw-r--r--Minecraft.World/SynchedEntityData.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Minecraft.World/SynchedEntityData.cpp b/Minecraft.World/SynchedEntityData.cpp
index 69d419b0..67b9597b 100644
--- a/Minecraft.World/SynchedEntityData.cpp
+++ b/Minecraft.World/SynchedEntityData.cpp
@@ -342,7 +342,10 @@ vector<shared_ptr<SynchedEntityData::DataItem> > *SynchedEntityData::unpack(Data
int currentHeader = input->readByte();
- while (currentHeader != EOF_MARKER)
+ int itemCount = 0;
+ const int MAX_ENTITY_DATA_ITEMS = 256;
+
+ while (currentHeader != EOF_MARKER && itemCount < MAX_ENTITY_DATA_ITEMS)
{
if (result == nullptr)
@@ -397,6 +400,7 @@ vector<shared_ptr<SynchedEntityData::DataItem> > *SynchedEntityData::unpack(Data
break;
}
result->push_back(item);
+ itemCount++;
currentHeader = input->readByte();
}