diff options
Diffstat (limited to 'modules/fbx')
-rw-r--r-- | modules/fbx/editor_scene_importer_fbx.cpp | 3 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXDocumentUtil.cpp | 2 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXProperties.cpp | 5 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXProperties.h | 1 |
4 files changed, 10 insertions, 1 deletions
diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp index 4d15ca93c1..55d524883f 100644 --- a/modules/fbx/editor_scene_importer_fbx.cpp +++ b/modules/fbx/editor_scene_importer_fbx.cpp @@ -104,6 +104,9 @@ Node3D *EditorSceneImporterFBX::import_scene(const String &p_path, uint32_t p_fl bool is_binary = false; data.resize(f->get_len()); + + ERR_FAIL_COND_V(data.size() < 64, NULL); + f->get_buffer(data.ptrw(), data.size()); PackedByteArray fbx_header; fbx_header.resize(64); diff --git a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp index 835b66ab23..df50a32c39 100644 --- a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp +++ b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp @@ -160,7 +160,7 @@ const PropertyTable *GetPropertyTable(const Document &doc, DOMWarning("property table (Properties70) not found", element); } if (templateProps) { - return templateProps; + return new const PropertyTable(templateProps); } else { return new const PropertyTable(); } diff --git a/modules/fbx/fbx_parser/FBXProperties.cpp b/modules/fbx/fbx_parser/FBXProperties.cpp index ea023b2629..84e71512d6 100644 --- a/modules/fbx/fbx_parser/FBXProperties.cpp +++ b/modules/fbx/fbx_parser/FBXProperties.cpp @@ -149,6 +149,11 @@ PropertyTable::PropertyTable() { } // ------------------------------------------------------------------------------------------------ +PropertyTable::PropertyTable(const PropertyTable *templateProps) : + templateProps(templateProps), element() { +} + +// ------------------------------------------------------------------------------------------------ PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *templateProps) : templateProps(templateProps), element(element) { const ScopePtr scope = GetRequiredScope(element); diff --git a/modules/fbx/fbx_parser/FBXProperties.h b/modules/fbx/fbx_parser/FBXProperties.h index 27cacfaf76..0595b25fa7 100644 --- a/modules/fbx/fbx_parser/FBXProperties.h +++ b/modules/fbx/fbx_parser/FBXProperties.h @@ -137,6 +137,7 @@ class PropertyTable { public: // in-memory property table with no source element PropertyTable(); + PropertyTable(const PropertyTable *templateProps); PropertyTable(const ElementPtr element, const PropertyTable *templateProps); ~PropertyTable(); |