Add missing OOB slot check to InventoryStore.

This commit is contained in:
Jordan Ayers 2016-01-11 07:24:52 -06:00
parent ef1a1125e0
commit 2ce2e8a1e7

View file

@ -523,6 +523,9 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, const MWWorld::Ptr& actor)
{
if (slot<0 || slot>=static_cast<int> (mSlots.size()))
throw std::runtime_error ("slot number out of range");
ContainerStoreIterator it = mSlots[slot];
if (it != end())