mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
fix potential fatal errors
This commit is contained in:
parent
6f466d52f2
commit
f246619c6b
3 changed files with 10 additions and 2 deletions
|
|
@ -133,6 +133,9 @@ static model::Mesh load_mesh(
|
|||
if (flags == FLAG_ZLIB) {
|
||||
throw std::runtime_error("compression is not supported yet");
|
||||
}
|
||||
if (attributeCount <= 0) {
|
||||
throw std::runtime_error("mesh must have at least one attribute");
|
||||
}
|
||||
std::vector<VertexAttribute> attributes;
|
||||
for (int i = 0; i < attributeCount; i++) {
|
||||
attributes.push_back(load_attribute(reader));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue