Skip to content

Commit

Permalink
Merge pull request #91198 from jsjtxietian/SurfaceTool
Browse files Browse the repository at this point in the history
Fix `SurfaceTool.create_from_arrays` crash with bad index
  • Loading branch information
akien-mga committed Apr 26, 2024
2 parents f55b81b + 01135bc commit 86bf835
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/resources/surface_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,8 @@ const uint32_t SurfaceTool::custom_mask[RS::ARRAY_CUSTOM_COUNT] = { Mesh::ARRAY_
const uint32_t SurfaceTool::custom_shift[RS::ARRAY_CUSTOM_COUNT] = { Mesh::ARRAY_FORMAT_CUSTOM0_SHIFT, Mesh::ARRAY_FORMAT_CUSTOM1_SHIFT, Mesh::ARRAY_FORMAT_CUSTOM2_SHIFT, Mesh::ARRAY_FORMAT_CUSTOM3_SHIFT };

void SurfaceTool::create_vertex_array_from_arrays(const Array &p_arrays, LocalVector<SurfaceTool::Vertex> &ret, uint64_t *r_format) {
ERR_FAIL_INDEX(RS::ARRAY_WEIGHTS, p_arrays.size());

ret.clear();

Vector<Vector3> varr = p_arrays[RS::ARRAY_VERTEX];
Expand Down

0 comments on commit 86bf835

Please sign in to comment.