Skip to content

Commit 24673c8

Browse files
committed
Do bounds check in WeightBuffer
1 parent d63c28a commit 24673c8

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

irr/src/SkinnedMesh.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ SkinnedMesh *SkinnedMeshBuilder::finalize() &&
399399
auto *buf = mesh->LocalBuffers.at(weight.buffer_id);
400400
if (!buf->Weights)
401401
buf->Weights = WeightBuffer(buf->getVertexCount());
402-
if (weight.vertex_id >= buf->Weights->size()) {
403-
throw std::out_of_range("vertex id out of range");
404-
}
405402
buf->Weights->addWeight(weight.vertex_id, weight.joint_id, weight.strength);
406403
}
407404

irr/src/WeightBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void WeightBuffer::VertexWeights::addWeight(u16 joint_id, f32 weight)
2121

2222
void WeightBuffer::addWeight(u32 vertex_id, u16 joint_id, f32 weight)
2323
{
24-
weights[vertex_id].addWeight(joint_id, weight);
24+
weights.at(vertex_id).addWeight(joint_id, weight);
2525
}
2626

2727
void WeightBuffer::VertexWeights::skinVertex(core::vector3df &pos, core::vector3df &normal,

0 commit comments

Comments
 (0)