mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-16 23:40:25 +01:00
Fix segfault from reading bad number of indices
This commit is contained in:
parent
79ffe6b6d8
commit
b47858cf80
|
@ -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