From bca701f0ebeeb68b07745ded9169c7c1a2761b77 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:42:54 -0700 Subject: [PATCH] fix segfault in GLTFDocument::export_object_model_property --- modules/gltf/gltf_document.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index c807f10550b..81cc3eea3b8 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -7066,7 +7066,8 @@ Ref GLTFDocument::export_object_model_property(Ref subpath = p_node_path.get_subnames(); ERR_FAIL_COND_V_MSG(subpath.is_empty(), ret, "glTF: Cannot export empty property. No property was specified in the NodePath: " + String(p_node_path)); int target_prop_depth = 0; - for (StringName subname : subpath) { + for (int64_t i = 0; i < subpath.size() - 1; i++) { + const StringName &subname = subpath[i]; Variant target_property = target_object->get(subname); if (target_property.get_type() == Variant::OBJECT) { target_object = target_property;