1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Fix error handling for out-of-range NIF roots (found in Bosmora, TR)

This commit is contained in:
scrawl 2015-06-09 18:22:18 +02:00
parent db16cdad02
commit c621d0400c

View File

@ -193,9 +193,9 @@ void NIFFile::parse()
for(size_t i = 0;i < rootNum;i++)
{
int idx = nif.getInt();
if (idx >= 0)
if (idx >= 0 && idx < int(records.size()))
{
roots[i] = records.at(idx);
roots[i] = records[idx];
}
else
{