From a71baaeedf6d471860b638737f1338509ab72fe3 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 24 Aug 2021 19:22:15 +0200 Subject: [PATCH 1/4] Enable Viewer only for VS-Builds --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a938f0d9..bfa30e96a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,11 +135,11 @@ IF ( WIN32 ) # Use subset of Windows.h ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) - OPTION ( ASSIMP_BUILD_ASSIMP_VIEW - "If the Assimp view tool is built. (requires DirectX)" - OFF ) - IF(MSVC) + OPTION ( ASSIMP_BUILD_ASSIMP_VIEW + "If the Assimp view tool is built. (requires DirectX)" + OFF ) + OPTION( ASSIMP_INSTALL_PDB "Install MSVC debug files." ON ) From eabfc05bbbfba39a6f78f023ac0fb4d2c9fdbc00 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 27 Aug 2021 10:41:25 +0200 Subject: [PATCH 2/4] Handle empty keys --- code/AssetLib/FBX/FBXParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/AssetLib/FBX/FBXParser.cpp b/code/AssetLib/FBX/FBXParser.cpp index 61e53c2d0..582940363 100644 --- a/code/AssetLib/FBX/FBXParser.cpp +++ b/code/AssetLib/FBX/FBXParser.cpp @@ -192,6 +192,10 @@ Scope::Scope(Parser& parser,bool topLevel) } const std::string& str = n->StringContents(); + if (str.empty()) { + ParseError("unexpected content: empty string."); + } + elements.insert(ElementMap::value_type(str,new_Element(*n,parser))); // Element() should stop at the next Key token (or right after a Close token) From a45878c41ad735a1e5f1755fcf0be14788f42021 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 27 Aug 2021 14:04:00 +0200 Subject: [PATCH 3/4] Fix possible overrun - closes https://github.com/assimp/assimp/issues/3425 --- code/Common/RemoveComments.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/Common/RemoveComments.cpp b/code/Common/RemoveComments.cpp index d1c2ac391..e1ba99761 100644 --- a/code/Common/RemoveComments.cpp +++ b/code/Common/RemoveComments.cpp @@ -59,13 +59,16 @@ void CommentRemover::RemoveLineComments(const char* szComment, ai_assert(nullptr != szBuffer); ai_assert(*szComment); - const size_t len = strlen(szComment); + size_t len = strlen(szComment); + const size_t lenBuffer = strlen(szBuffer); + if (len > lenBuffer) { + len = lenBuffer; + } while (*szBuffer) { // skip over quotes if (*szBuffer == '\"' || *szBuffer == '\'') while (*szBuffer++ && *szBuffer != '\"' && *szBuffer != '\''); - if (!strncmp(szBuffer,szComment,len)) { while (!IsLineEnd(*szBuffer)) *szBuffer++ = chReplacement; From 999192489c379814fc108761e6acec814d0b2c9b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 27 Aug 2021 14:52:48 +0200 Subject: [PATCH 4/4] Delete FindIrrXML.cmake - Deprecated --- cmake-modules/FindIrrXML.cmake | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 cmake-modules/FindIrrXML.cmake diff --git a/cmake-modules/FindIrrXML.cmake b/cmake-modules/FindIrrXML.cmake deleted file mode 100644 index 5434e0b86..000000000 --- a/cmake-modules/FindIrrXML.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# Find IrrXMl from irrlicht project -# -# Find LibIrrXML headers and library -# -# IRRXML_FOUND - IrrXML found -# IRRXML_INCLUDE_DIR - Headers location -# IRRXML_LIBRARY - IrrXML main library - -find_path(IRRXML_INCLUDE_DIR irrXML.h - PATH_SUFFIXES include/irrlicht include/irrxml) -find_library(IRRXML_LIBRARY IrrXML) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(IrrXML REQUIRED_VARS IRRXML_INCLUDE_DIR IRRXML_LIBRARY) - - -mark_as_advanced(IRRXML_INCLUDE_DIR IRRXML_LIBRARY)