Merge pull request #84047 from clayjohn/mesh-3x-upgrade-crash

Fix crash when upgrading meshes from 3.x format
This commit is contained in:
Rémi Verschelde 2023-10-27 13:33:30 +02:00
commit 5664f09f78
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1019,7 +1019,7 @@ void _fix_array_compatibility(const Vector<uint8_t> &p_src, uint64_t p_old_forma
uint32_t dst_offsets[Mesh::ARRAY_MAX];
RenderingServer::get_singleton()->mesh_surface_make_offsets_from_format(p_new_format & (~RS::ARRAY_FORMAT_INDEX), p_elements, 0, dst_offsets, dst_vertex_stride, dst_normal_tangent_stride, dst_attribute_stride, dst_skin_stride);
vertex_data.resize(dst_vertex_stride * p_elements);
vertex_data.resize((dst_vertex_stride + dst_normal_tangent_stride) * p_elements);
attribute_data.resize(dst_attribute_stride * p_elements);
skin_data.resize(dst_skin_stride * p_elements);