mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Check for negative record list length
This commit is contained in:
parent
0688b6de40
commit
06f7e8088e
1 changed files with 3 additions and 0 deletions
|
@ -92,6 +92,9 @@ namespace Nif
|
||||||
{
|
{
|
||||||
const int length = nif->getInt();
|
const int length = nif->getInt();
|
||||||
|
|
||||||
|
if (length < 0)
|
||||||
|
throw std::runtime_error("Negative NIF record list length: " + std::to_string(length));
|
||||||
|
|
||||||
list.resize(static_cast<std::size_t>(length));
|
list.resize(static_cast<std::size_t>(length));
|
||||||
|
|
||||||
for (auto& value : list)
|
for (auto& value : list)
|
||||||
|
|
Loading…
Reference in a new issue