X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fstaticobject.cpp;h=1160ec68f1c01dee8aa3c6791eec6ecf65ae09fc;hb=391eec9ee78fc9dfdc476ad2a8ed7755009e4a2f;hp=5ccb7baf5227893eeb366693eca6c226349dda76;hpb=5146086a64d5eeb480948d612a008a2ec81455d4;p=minetest.git diff --git a/src/staticobject.cpp b/src/staticobject.cpp index 5ccb7baf5..1160ec68f 100644 --- a/src/staticobject.cpp +++ b/src/staticobject.cpp @@ -35,8 +35,9 @@ void StaticObject::serialize(std::ostream &os) // pos writeV3F1000(os, pos); // data - os< bool { + if (obj.data.size() > U16_MAX) { + errorstream << "StaticObjectList::serialize(): " + "object has excessive static data (" << obj.data.size() << + "), deleting it." << std::endl; + return true; + } + return false; + }; + for (auto it = m_stored.begin(); it != m_stored.end(); ) { + if (problematic(*it)) + it = m_stored.erase(it); + else + it++; + } + for (auto it = m_active.begin(); it != m_active.end(); ) { + if (problematic(it->second)) + it = m_active.erase(it); + else + it++; + } + // version u8 version = 0; writeU8(os, version);