Fix Coverity warnings

macos_ci_fix
Andrei Kortunov 1 year ago
parent e11bee250f
commit aeb46f5fba

@ -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);

Loading…
Cancel
Save