mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-13 14:00:27 +01:00
Fix segfault from reading bad number of indices
This commit is contained in:
parent
f1042bf4c4
commit
0216a02ed4
|
@ -194,7 +194,7 @@ static u16* getIndices(const tinygltf::Model& model,
|
|||
const auto& indicesBuffer = model.buffers[view.buffer];
|
||||
return readIndices(
|
||||
BufferOffset(indicesBuffer.data, view.byteOffset),
|
||||
model.accessors[0].count);
|
||||
model.accessors[accessorId].count);
|
||||
}
|
||||
|
||||
CGLTFMeshFileLoader::CGLTFMeshFileLoader()
|
||||
|
|
|
@ -91,6 +91,7 @@ TEST_CASE("blender cube") {
|
|||
CHECK(indices[0] == 0);
|
||||
CHECK(indices[1] == 3);
|
||||
CHECK(indices[2] == 9);
|
||||
CHECK(indices[35] == 16);
|
||||
}
|
||||
|
||||
SECTION("vertex normals are correct") {
|
||||
|
|
Loading…
Reference in New Issue
Block a user