Quellcode durchsuchen

Fix SurfaceTool crash with invalid bone/weight count

Fixes #53191.
Rémi Verschelde vor 2 Jahren
Ursprung
Commit
77b415ab6d
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      scene/resources/surface_tool.cpp

+ 2 - 2
scene/resources/surface_tool.cpp

@@ -648,7 +648,7 @@ Array SurfaceTool::commit_to_arrays() {
 				for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {
 					const Vertex &v = vertex_array[idx];
 
-					if (v.bones.size() > count) {
+					if (v.bones.size() != count) {
 						ERR_PRINT_ONCE(vformat("Invalid bones size %d vs count %d", v.bones.size(), count));
 						continue;
 					}
@@ -672,7 +672,7 @@ Array SurfaceTool::commit_to_arrays() {
 				for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {
 					const Vertex &v = vertex_array[idx];
 
-					if (v.weights.size() > count) {
+					if (v.weights.size() != count) {
 						ERR_PRINT_ONCE(vformat("Invalid weight size %d vs count %d", v.weights.size(), count));
 						continue;
 					}