From 6f70e220e4f8f975ee931ebb0884da49c33159f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 6 Nov 2023 11:09:22 +0100 Subject: [PATCH 1/8] always include "utf8.h" (instead of contrib/.../utf8.h) --- code/AssetLib/MMD/MMDPmxParser.cpp | 6 +----- code/AssetLib/SIB/SIBImporter.cpp | 6 +----- code/AssetLib/STEPParser/STEPFileEncoding.cpp | 6 +----- code/Common/BaseImporter.cpp | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/code/AssetLib/MMD/MMDPmxParser.cpp b/code/AssetLib/MMD/MMDPmxParser.cpp index 42e835c66..6b04f02e9 100644 --- a/code/AssetLib/MMD/MMDPmxParser.cpp +++ b/code/AssetLib/MMD/MMDPmxParser.cpp @@ -42,11 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "MMDPmxParser.h" #include -#ifdef ASSIMP_USE_HUNTER -# include -#else -# include "../contrib/utf8cpp/source/utf8.h" -#endif +#include "utf8.h" #include namespace pmx diff --git a/code/AssetLib/SIB/SIBImporter.cpp b/code/AssetLib/SIB/SIBImporter.cpp index 26b1c5227..840f74b7d 100644 --- a/code/AssetLib/SIB/SIBImporter.cpp +++ b/code/AssetLib/SIB/SIBImporter.cpp @@ -56,11 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#ifdef ASSIMP_USE_HUNTER -#include -#else -#include "../contrib/utf8cpp/source/utf8.h" -#endif +#include "utf8.h" #include #include #include diff --git a/code/AssetLib/STEPParser/STEPFileEncoding.cpp b/code/AssetLib/STEPParser/STEPFileEncoding.cpp index d4456e674..92eb4f284 100644 --- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp +++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp @@ -45,11 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "STEPFileEncoding.h" #include -#ifdef ASSIMP_USE_HUNTER -# include -#else -# include -#endif +#include "utf8.h" #include diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp index a169c8a10..9ef69a8e6 100644 --- a/code/Common/BaseImporter.cpp +++ b/code/Common/BaseImporter.cpp @@ -357,11 +357,7 @@ std::string BaseImporter::GetExtension(const std::string &pFile) { return false; } -#ifdef ASSIMP_USE_HUNTER -#include -#else -#include "../contrib/utf8cpp/source/utf8.h" -#endif +#include "utf8.h" // ------------------------------------------------------------------------------------------------ // Convert to UTF8 data From bfdd154d14b3f653cbcb9494876236e34c7e39ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 6 Nov 2023 13:32:35 +0100 Subject: [PATCH 2/8] Always include "zlib.h" (rather than .../contrib/zlib/zlib.h) The path to the vendored zlib is set by the build-system, so there's no need to add additional preprocessor magic --- code/AssetLib/Assbin/AssbinFileWriter.cpp | 6 +----- code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp | 6 +----- code/Common/Compression.h | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/code/AssetLib/Assbin/AssbinFileWriter.cpp b/code/AssetLib/Assbin/AssbinFileWriter.cpp index e9d857a84..782595bc1 100644 --- a/code/AssetLib/Assbin/AssbinFileWriter.cpp +++ b/code/AssetLib/Assbin/AssbinFileWriter.cpp @@ -50,11 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#ifdef ASSIMP_BUILD_NO_OWN_ZLIB -#include -#else -#include "../contrib/zlib/zlib.h" -#endif +#include "zlib.h" #include diff --git a/code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp b/code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp index 30b1bf053..3c56775e8 100644 --- a/code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp +++ b/code/AssetLib/Q3BSP/Q3BSPFileImporter.cpp @@ -48,11 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#ifdef ASSIMP_BUILD_NO_OWN_ZLIB -#include -#else -#include "../contrib/zlib/zlib.h" -#endif +#include "zlib.h" #include #include diff --git a/code/Common/Compression.h b/code/Common/Compression.h index 13a79af3f..cfedc7409 100644 --- a/code/Common/Compression.h +++ b/code/Common/Compression.h @@ -41,11 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once -#ifdef ASSIMP_BUILD_NO_OWN_ZLIB -# include -#else -# include "../contrib/zlib/zlib.h" -#endif +#include "zlib.h" #include #include // size_t From 6f715edfa091c4bcd6fc5e468d446a5b71139b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 6 Nov 2023 13:32:54 +0100 Subject: [PATCH 3/8] Drop disabled zlib.h inclusion stubs --- code/AssetLib/FBX/FBXParser.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/AssetLib/FBX/FBXParser.cpp b/code/AssetLib/FBX/FBXParser.cpp index 955e811cb..7baa7ed39 100644 --- a/code/AssetLib/FBX/FBXParser.cpp +++ b/code/AssetLib/FBX/FBXParser.cpp @@ -45,12 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_FBX_IMPORTER -//#ifdef ASSIMP_BUILD_NO_OWN_ZLIB #include "Common/Compression.h" -//# include -//#else -//# include "../contrib/zlib/zlib.h" -//#endif #include "FBXTokenizer.h" #include "FBXParser.h" From a63a6011c5db6e55ab60eb8554b505b437ba2594 Mon Sep 17 00:00:00 2001 From: ccn Date: Sun, 5 Nov 2023 22:20:16 -0500 Subject: [PATCH 4/8] Update Build.md Add more details about the default build. --- Build.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Build.md b/Build.md index 957031b5f..9440a0073 100644 --- a/Build.md +++ b/Build.md @@ -43,6 +43,7 @@ cd assimp cmake CMakeLists.txt cmake --build . ``` +Note that by default this builds a shared library into the `bin` directory. If you want to build it as a static library see the build options at the bottom of this file. ### Build instructions for Windows with Visual-Studio From f701d702e4363a48688412c1e376437497f06111 Mon Sep 17 00:00:00 2001 From: Maksim Kostin Date: Mon, 13 Nov 2023 11:27:44 +0300 Subject: [PATCH 5/8] Fix buffer overflow in FBX::Util::DecodeBase64() --- code/AssetLib/FBX/FBXUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/FBX/FBXUtil.cpp b/code/AssetLib/FBX/FBXUtil.cpp index ac465d6e9..e2903c536 100644 --- a/code/AssetLib/FBX/FBXUtil.cpp +++ b/code/AssetLib/FBX/FBXUtil.cpp @@ -155,7 +155,7 @@ size_t DecodeBase64(const char* in, size_t inLength, uint8_t* out, size_t maxOut const size_t realLength = inLength - size_t(in[inLength - 1] == '=') - size_t(in[inLength - 2] == '='); size_t dst_offset = 0; int val = 0, valb = -8; - for (size_t src_offset = 0; src_offset < realLength; ++src_offset) + for (size_t src_offset = 0; src_offset < realLength && dst_offset < maxOutLength; ++src_offset) { const uint8_t table_value = Util::DecodeBase64(in[src_offset]); if (table_value == 255) From e765862d2493b4ed6408cea8c4e50b5df56f8fb6 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Mon, 27 Nov 2023 13:11:23 -0800 Subject: [PATCH 6/8] Readme.md: correct 2 errors in section headers --- Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 94f938970..a1f707a95 100644 --- a/Readme.md +++ b/Readme.md @@ -15,10 +15,10 @@ Open Asset Import Library is a library to load various 3d file formats into a sh APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. Additionally, assimp features various __mesh post-processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more. -### Latest Doc's ### +### Documentation ### Please check the latest documents at [Asset-Importer-Lib-Doc](https://assimp-docs.readthedocs.io/en/latest/). -### Prebuild binaries ### +### Pre-built binaries ### Please check our [Itchi Projectspace](https://kimkulling.itch.io/the-asset-importer-lib) If you want to check our Model-Database, use the following repo: https://github.com/assimp/assimp-mdb From d311fa95c61fe8177b14c9b04453190efd9d83cf Mon Sep 17 00:00:00 2001 From: Maksim Kostin Date: Mon, 13 Nov 2023 12:06:56 +0300 Subject: [PATCH 7/8] Fix double free in Video::~Video() --- code/AssetLib/FBX/FBXMaterial.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/FBX/FBXMaterial.cpp b/code/AssetLib/FBX/FBXMaterial.cpp index 2f575a511..bcb9bc42a 100644 --- a/code/AssetLib/FBX/FBXMaterial.cpp +++ b/code/AssetLib/FBX/FBXMaterial.cpp @@ -367,7 +367,9 @@ Video::Video(uint64_t id, const Element &element, const Document &doc, const std } Video::~Video() { - delete[] content; + if (contentLength > 0) { + delete[] content; + } } } //!FBX From 769e82ce5e9ad064e6792e84a0178d032b7039cc Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Sat, 18 Nov 2023 14:21:58 -0800 Subject: [PATCH 8/8] FBXMeshGeometry: solve issue #5116 using patch provided by darktjm --- code/AssetLib/FBX/FBXMeshGeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXMeshGeometry.cpp b/code/AssetLib/FBX/FBXMeshGeometry.cpp index fcbaac169..8c6499a91 100644 --- a/code/AssetLib/FBX/FBXMeshGeometry.cpp +++ b/code/AssetLib/FBX/FBXMeshGeometry.cpp @@ -467,9 +467,9 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, std::vector uvIndices; ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName)); - if (uvIndices.size() != vertex_count) { + if (uvIndices.size() != mapping_offsets.size()) { FBXImporter::LogError("length of input data unexpected for ByVertice mapping: ", - uvIndices.size(), ", expected ", vertex_count); + uvIndices.size(), ", expected ", mapping_offsets.size()); return; }