From 9efc6d85d86dcb469b458dabe382e641f67ea729 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 22 Nov 2018 17:26:31 -0300 Subject: Do not crash on invalid file, closes #21083 --- editor/import/editor_scene_importer_gltf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editor/import') diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index f47252d388..00ca86a43b 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1695,7 +1695,7 @@ void EditorSceneImporterGLTF::_generate_node(GLTFState &state, int p_node, Node n->godot_nodes.push_back(node); - if (n->skin >= 0 && Object::cast_to(node)) { + if (n->skin >= 0 && n->skin < skeletons.size() && Object::cast_to(node)) { MeshInstance *mi = Object::cast_to(node); Skeleton *s = skeletons[n->skin]; -- cgit v1.2.3