1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-16 16:20:53 +00:00

NIFStream: don't read vectors of zero length

This commit is contained in:
Alexei Kotov 2023-07-26 05:36:03 +03:00
parent d078907dcb
commit 6dca3e68a6

View File

@ -107,6 +107,8 @@ namespace Nif
template <class T>
void readVector(std::vector<T>& vec, size_t size)
{
if (size == 0)
return;
vec.resize(size);
read(vec.data(), size);
}