mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Validate before passing indices to meshoptimizer
This commit is contained in:
@@ -1176,6 +1176,7 @@ Vector<int> SurfaceTool::generate_lod(float p_threshold, int p_target_index_coun
|
|||||||
ERR_FAIL_COND_V(simplify_func == nullptr, lod);
|
ERR_FAIL_COND_V(simplify_func == nullptr, lod);
|
||||||
ERR_FAIL_COND_V(vertex_array.size() == 0, lod);
|
ERR_FAIL_COND_V(vertex_array.size() == 0, lod);
|
||||||
ERR_FAIL_COND_V(index_array.size() == 0, lod);
|
ERR_FAIL_COND_V(index_array.size() == 0, lod);
|
||||||
|
ERR_FAIL_COND_V(index_array.size() % 3 != 0, lod);
|
||||||
|
|
||||||
lod.resize(index_array.size());
|
lod.resize(index_array.size());
|
||||||
LocalVector<float> vertices; //uses floats
|
LocalVector<float> vertices; //uses floats
|
||||||
|
|||||||
Reference in New Issue
Block a user