1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 07:45:39 +00:00

Fix Coverity warnings

This commit is contained in:
Andrei Kortunov 2023-11-12 11:37:03 +04:00
parent e11bee250f
commit aeb46f5fba

View file

@ -413,7 +413,7 @@ namespace Nif
if (!hasPresenceFlags || nif->get<bool>())
nif->readVector(mVertexMap, numVertices);
if (!hasPresenceFlags || nif->get<bool>())
nif->readVector(mWeights, numVertices * bonesPerVertex);
nif->readVector(mWeights, static_cast<size_t>(numVertices) * bonesPerVertex);
std::vector<unsigned short> stripLengths;
nif->readVector(stripLengths, numStrips);
if (!hasPresenceFlags || nif->get<bool>())
@ -428,7 +428,7 @@ namespace Nif
nif->readVector(mTriangles, numTriangles * 3);
}
if (nif->get<uint8_t>() != 0)
nif->readVector(mBoneIndices, numVertices * bonesPerVertex);
nif->readVector(mBoneIndices, static_cast<size_t>(numVertices) * bonesPerVertex);
if (nif->getBethVersion() > NIFFile::BethVersion::BETHVER_FO3)
{
nif->read(mLODLevel);