From 26233f1b77767d9a0455b02ce9bd972f36cbf7fe Mon Sep 17 00:00:00 2001 From: Matthew Clendening Date: Thu, 26 May 2022 15:06:23 -0400 Subject: [PATCH 1/8] Fixed FBXConverter build error (warning as error) when ASSIMP_DOUBLE_PRECISION is defined --- code/AssetLib/FBX/FBXConverter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 4de142075..9ce593122 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -648,7 +648,7 @@ bool FBXConverter::NeedsComplexTransformationChain(const Model &model) { const PropertyTable &props = model.Props(); bool ok; - const float zero_epsilon = ai_epsilon; + const auto zero_epsilon = ai_epsilon; const aiVector3D all_ones(1.0f, 1.0f, 1.0f); for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i) { const TransformationComp comp = static_cast(i); @@ -3180,7 +3180,7 @@ aiNodeAnim* FBXConverter::GenerateSimpleNodeAnim(const std::string& name, bool ok = false; - const float zero_epsilon = ai_epsilon; + const auto zero_epsilon = ai_epsilon; const aiVector3D& preRotation = PropertyGet(props, "PreRotation", ok); if (ok && preRotation.SquareLength() > zero_epsilon) { From 681eb3e91efe13fdf8e6ba9fd50f2f3587ff91eb Mon Sep 17 00:00:00 2001 From: nsg <40836757+Nor-s@users.noreply.github.com> Date: Wed, 1 Jun 2022 17:41:27 +0900 Subject: [PATCH 2/8] Fix Import a specific FBX model --- code/AssetLib/FBX/FBXConverter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 4de142075..43be6d28d 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -3318,9 +3318,9 @@ FBXConverter::KeyFrameListList FBXConverter::GetRotationKeyframeList(const std:: float vc = curve->GetValues().at(1); for (size_t n = 1; n < count; n++) { while (std::abs(vc - vp) >= 180.0f) { - float step = std::floor(float(tc - tp) / (vc - vp) * 179.0f); + double step = std::floor(double(tc - tp) / std::abs(vc - vp) * 179.0f); int64_t tnew = tp + int64_t(step); - float vnew = vp + (vc - vp) * step / float(tc - tp); + float vnew = vp + (vc - vp) * float(step / (tc - tp)); if (tnew >= adj_start && tnew <= adj_stop) { Keys->push_back(tnew); Values->push_back(vnew); From 4961241c09ff68d7eed4e36916885ca6a1e73b48 Mon Sep 17 00:00:00 2001 From: ethaninfinity Date: Mon, 6 Jun 2022 14:53:03 -0400 Subject: [PATCH 3/8] Removed pragma warnings --- contrib/unzip/crypt.c | 9 --------- contrib/unzip/ioapi.c | 3 --- contrib/unzip/unzip.c | 11 +---------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/contrib/unzip/crypt.c b/contrib/unzip/crypt.c index 299ce03d2..22436baab 100644 --- a/contrib/unzip/crypt.c +++ b/contrib/unzip/crypt.c @@ -43,11 +43,6 @@ #include "crypt.h" -#ifdef _WIN32 -# pragma warning(push) -# pragma warning(disable : 4244) -#endif // _WIN32 - /***************************************************************************/ #define CRC32(c, b) ((*(pcrc_32_tab+(((uint32_t)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) @@ -164,8 +159,4 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys, return n; } -#ifdef _WIN32 -# pragma warning(pop) -#endif // _WIN32 - /***************************************************************************/ diff --git a/contrib/unzip/ioapi.c b/contrib/unzip/ioapi.c index 30a296d0f..99295f0f8 100644 --- a/contrib/unzip/ioapi.c +++ b/contrib/unzip/ioapi.c @@ -23,8 +23,6 @@ #ifdef _WIN32 # define snprintf _snprintf -# pragma warning(push) -# pragma warning(disable : 4131 4100) # ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunused-parameter" @@ -358,7 +356,6 @@ void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def) } #ifdef _WIN32 -# pragma warning(pop) # ifdef __clang__ # pragma clang diagnostic pop # endif diff --git a/contrib/unzip/unzip.c b/contrib/unzip/unzip.c index f1eddeeda..311a6ae03 100644 --- a/contrib/unzip/unzip.c +++ b/contrib/unzip/unzip.c @@ -73,11 +73,6 @@ # define TRYFREE(p) {if (p) free(p);} #endif -#ifdef _WIN32 -# pragma warning(push) -# pragma warning(disable : 4131 4244 4189 4245) -#endif // _WIN32 - const char unz_copyright[] = " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; @@ -1993,8 +1988,4 @@ extern int ZEXPORT unzEndOfFile(unzFile file) if (s->pfile_in_zip_read->rest_read_uncompressed == 0) return 1; return 0; -} - -#ifdef _WIN32 -# pragma warning(pop) -#endif // _WIN32 \ No newline at end of file +} \ No newline at end of file From c5b6b26b8b1b19839504f8f76b2fa030c1bc9cd3 Mon Sep 17 00:00:00 2001 From: ethaninfinity Date: Tue, 7 Jun 2022 11:27:12 -0400 Subject: [PATCH 4/8] Revert "Removed pragma warnings" This reverts commit 4961241c09ff68d7eed4e36916885ca6a1e73b48. --- contrib/unzip/crypt.c | 9 +++++++++ contrib/unzip/ioapi.c | 3 +++ contrib/unzip/unzip.c | 11 ++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/contrib/unzip/crypt.c b/contrib/unzip/crypt.c index 22436baab..299ce03d2 100644 --- a/contrib/unzip/crypt.c +++ b/contrib/unzip/crypt.c @@ -43,6 +43,11 @@ #include "crypt.h" +#ifdef _WIN32 +# pragma warning(push) +# pragma warning(disable : 4244) +#endif // _WIN32 + /***************************************************************************/ #define CRC32(c, b) ((*(pcrc_32_tab+(((uint32_t)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) @@ -159,4 +164,8 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys, return n; } +#ifdef _WIN32 +# pragma warning(pop) +#endif // _WIN32 + /***************************************************************************/ diff --git a/contrib/unzip/ioapi.c b/contrib/unzip/ioapi.c index 99295f0f8..30a296d0f 100644 --- a/contrib/unzip/ioapi.c +++ b/contrib/unzip/ioapi.c @@ -23,6 +23,8 @@ #ifdef _WIN32 # define snprintf _snprintf +# pragma warning(push) +# pragma warning(disable : 4131 4100) # ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunused-parameter" @@ -356,6 +358,7 @@ void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def) } #ifdef _WIN32 +# pragma warning(pop) # ifdef __clang__ # pragma clang diagnostic pop # endif diff --git a/contrib/unzip/unzip.c b/contrib/unzip/unzip.c index 311a6ae03..f1eddeeda 100644 --- a/contrib/unzip/unzip.c +++ b/contrib/unzip/unzip.c @@ -73,6 +73,11 @@ # define TRYFREE(p) {if (p) free(p);} #endif +#ifdef _WIN32 +# pragma warning(push) +# pragma warning(disable : 4131 4244 4189 4245) +#endif // _WIN32 + const char unz_copyright[] = " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; @@ -1988,4 +1993,8 @@ extern int ZEXPORT unzEndOfFile(unzFile file) if (s->pfile_in_zip_read->rest_read_uncompressed == 0) return 1; return 0; -} \ No newline at end of file +} + +#ifdef _WIN32 +# pragma warning(pop) +#endif // _WIN32 \ No newline at end of file From d018c3b55577da5cf2affc1635109690d1e6d143 Mon Sep 17 00:00:00 2001 From: ethaninfinity Date: Tue, 7 Jun 2022 11:42:09 -0400 Subject: [PATCH 5/8] Added back pragma warnings and changed to be MSVC-specific --- contrib/unzip/crypt.c | 8 ++++---- contrib/unzip/ioapi.c | 6 ++++-- contrib/unzip/unzip.c | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/contrib/unzip/crypt.c b/contrib/unzip/crypt.c index 299ce03d2..4cc731b3e 100644 --- a/contrib/unzip/crypt.c +++ b/contrib/unzip/crypt.c @@ -43,10 +43,10 @@ #include "crypt.h" -#ifdef _WIN32 +#ifdef _MSC_VER # pragma warning(push) # pragma warning(disable : 4244) -#endif // _WIN32 +#endif // _MSC_VER /***************************************************************************/ @@ -164,8 +164,8 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys, return n; } -#ifdef _WIN32 +#ifdef _MSC_VER # pragma warning(pop) -#endif // _WIN32 +#endif // _MSC_VER /***************************************************************************/ diff --git a/contrib/unzip/ioapi.c b/contrib/unzip/ioapi.c index 30a296d0f..d9ae01e7d 100644 --- a/contrib/unzip/ioapi.c +++ b/contrib/unzip/ioapi.c @@ -23,8 +23,10 @@ #ifdef _WIN32 # define snprintf _snprintf +#ifdef _MSC_VER # pragma warning(push) # pragma warning(disable : 4131 4100) +#endif # ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunused-parameter" @@ -357,9 +359,9 @@ void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def) pzlib_filefunc_def->opaque = NULL; } -#ifdef _WIN32 +#ifdef _MSC_VER # pragma warning(pop) # ifdef __clang__ # pragma clang diagnostic pop # endif -#endif // _WIN32 +#endif // _MSC_VER diff --git a/contrib/unzip/unzip.c b/contrib/unzip/unzip.c index f1eddeeda..b2f045b0a 100644 --- a/contrib/unzip/unzip.c +++ b/contrib/unzip/unzip.c @@ -73,10 +73,10 @@ # define TRYFREE(p) {if (p) free(p);} #endif -#ifdef _WIN32 +#ifdef _MSC_VER # pragma warning(push) # pragma warning(disable : 4131 4244 4189 4245) -#endif // _WIN32 +#endif // _MSC_VER const char unz_copyright[] = " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; @@ -1995,6 +1995,6 @@ extern int ZEXPORT unzEndOfFile(unzFile file) return 0; } -#ifdef _WIN32 +#ifdef _MSC_VER # pragma warning(pop) -#endif // _WIN32 \ No newline at end of file +#endif // _MSC_VER \ No newline at end of file From 096aee2c25906c1166a4108c3496f30c9352a38d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 7 Jun 2022 20:58:45 +0200 Subject: [PATCH 6/8] Create SECURITY.md - Prepare a first contact point for security vulnerability --- SECURITY.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..e4915cd1c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.2.4 | :white_check_mark: | + +## Reporting a Vulnerability + +If you have found any security vulnerability you can contact us via +kim.kulling@googlemail.com + From 4fb5cf4ba6102c4e62113cc37b53c383c9c11708 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 7 Jun 2022 23:33:56 +0200 Subject: [PATCH 7/8] Fix possible nullptr exception - closes https://github.com/assimp/assimp/issues/4418 --- code/AssetLib/glTF2/glTF2Exporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index ffd8d223e..932fc4197 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -908,7 +908,7 @@ Ref FindSkeletonRootJoint(Ref &skinRef) { do { startNodeRef = parentNodeRef; parentNodeRef = startNodeRef->parent; - } while (!parentNodeRef->jointName.empty()); + } while (nullptr != parentNodeRef && !parentNodeRef->jointName.empty()); return parentNodeRef; } From 02b0c89fa4bec9358caadb77ebe8815d9104a76e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 8 Jun 2022 00:10:13 +0200 Subject: [PATCH 8/8] Fix usage of validation --- code/AssetLib/glTF2/glTF2Exporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index 932fc4197..d2f413932 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -908,7 +908,7 @@ Ref FindSkeletonRootJoint(Ref &skinRef) { do { startNodeRef = parentNodeRef; parentNodeRef = startNodeRef->parent; - } while (nullptr != parentNodeRef && !parentNodeRef->jointName.empty()); + } while (parentNodeRef && !parentNodeRef->jointName.empty()); return parentNodeRef; }