Commit Graph

54 Commits (a51500ba2be28592c49f601b79a7030143232c11)

Author SHA1 Message Date
Kim Kulling 01231d0e60
Add 2024 to copyright infos (#5475) 2024-02-23 22:30:05 +01:00
Kim Kulling 8cf2d6e588 Refactoring: Some cleanups 2023-11-12 21:09:33 +01:00
Kim Kulling f830d7998e
Merge branch 'master' into clean-up-ctors-dtors 2023-01-23 21:21:34 +01:00
Krishty 36305cf987 Tidy Up Constructors and Destructors
This commit does not add or remove c’tors or d’tors, so it is *not* ABI-breaking.

If a c’tor/d’tor does nothing else than the default behavior, this commit replaces it with “= default”.

If an initializer list entry does nothing else than the default behavior, this commit removes it. First and foremost, remove default c’tor calls of base classes (always called by the compiler if no other base c’tor is explicitly called) and c’tor calls of members with complex types (e.g. “std::vector”).

In a few instances, user-defined copy c’tors / move c’tors / assignment operators / move assignment operators were replaced with “= default”, too. I only did this if I had a clear understanding of what’s going on.
2023-01-16 21:47:11 +01:00
Krishty 5cbc00a595 Fix Build With M3D Import Only
`M3DWrapper.h` is designed to omit the definition of `class M3DWrapper` if neither M3D import nor M3D export are compiled.
608bccd9cf touched the corresponding preprocessor checks and introduced a bug:
```
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
class M3DWrapper {
```
When compiling
- with M3D import enabled,
- but with either export generally disabled or M3D export disabled specifically,
These checks evaluate to the wrong result and skip the definition, leading to a build failure in dependent code.
```
#if 1 // import enabled
#if !(1 || 1) // export disabled and M3D export disabled
```
This commit fixes the check to compile the definition if neither import is disabled.
2023-01-16 08:29:49 +01:00
Kim Kulling e5cd85ac0c
Update M3DWrapper.h 2022-05-31 19:16:46 +02:00
Kim Kulling 97c7ab3c05 Move stb_image header into its own header file. 2022-04-05 19:53:41 +02:00
Kim Kulling b8658cefe0 Link std_image statically. 2022-04-05 18:48:45 +02:00
Kim Kulling 331cb5ac72
Update M3DImporter.cpp 2022-01-18 22:23:01 +01:00
Kim Kulling 05746acb07 Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection 2022-01-16 20:41:24 +01:00
Kim Kulling 50c7301a38 Update copyrights 2022-01-10 21:13:43 +01:00
Kim Kulling 159fadebbf
Update M3DExporter.cpp 2021-11-12 17:53:46 +01:00
Kim Kulling f03dcc27c0
Update M3DExporter.h 2021-11-12 15:39:21 +01:00
Kim Kulling ece61c6c68
Update M3DWrapper.cpp 2021-11-12 09:17:32 +01:00
Kim Kulling 608bccd9cf
Update M3DWrapper.h 2021-11-12 09:13:48 +01:00
Alex Rebert 30f17aa206
Fix heap out-of-bounds write in _m3d_safestr
While there is a 256 character limit when computing the length of the
newly allocated strength, that limit was missing when copying the
string. This commit adds a new length check in the copy loop, preventing
it from writhing out of bounds.

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34416
2021-10-28 21:32:38 -04:00
IOhannes m zmölnig 3b8126d26a Fix spelling mistake 2021-10-08 08:48:01 +02:00
Kim Kulling 18531e3677 Next iteration for c++11 features. 2021-09-13 22:38:20 +02:00
kovacsv 0590a39159 Fix M3D import crash and memory leak.
The same default material pointer was assigned to all the materials in the scene, so poor destructor tried to free the same pointer multiple times.
2021-08-24 07:26:20 +02:00
Krishty 758116b083 removed trailing spaces and tabs from source and text
This commit ignores the “contrib” folder in order to prevent merge conflicts in dependencies, should these be updated via git.
2021-07-29 13:28:51 +02:00
Kim Kulling aeae2cf242
Update M3DWrapper.h 2021-07-26 14:44:26 +02:00
Kim Kulling e8e720d584
Update M3DWrapper.h 2021-07-26 13:41:54 +02:00
Kim Kulling 291c0a4faa
Fix build failure
- Fix the failure
- Put inlined stuff out of declaration
- Add some docu
2021-07-26 13:13:21 +02:00
Kim Kulling df2e7208fb
Fix fuzzer issue in m3d-importer
- closes https://github.com/assimp/assimp/issues/3974
- Check for nullptr before dereferencing name in m3d-data-instance.
2021-07-26 11:56:26 +02:00
Rahul Sheth 1b37b74f9e Hunter fixes for stb_image 2021-07-07 17:01:19 -04:00
Rahul Sheth 0a5e49252d Merge remote-tracking branch 'origin/master' into HEAD 2021-07-07 16:35:29 -04:00
Aaron Gokaslan 94c3abd841 Apply various performance fixes from clang-tidy 2021-06-22 12:27:15 -04:00
Kim Kulling e0d1a36523
Merge branch 'master' into stb-image-updated 2021-06-03 23:07:38 +02:00
Malcolm Tyrrell 54a27f4514
Merge branch 'master' into MalcolmTyrrell/loggingImprovements 2021-05-17 13:32:02 +01:00
Malcolm Tyrrell 4ec01cfdcd Improve use of logging 2021-05-13 12:05:31 +01:00
Malcolm Tyrrell 5cd3bdd5c2 No need to distinguish formatting log functions. 2021-05-13 10:25:27 +01:00
Kim Kulling b70f195805
Merge branch 'master' into M3DasciiByDefault 2021-05-12 15:31:01 +02:00
Kim Kulling 433620350e
Merge branch 'master' into stb-image-updated 2021-05-10 11:30:45 +02:00
Krishty 816da9b677 merge and update all copies of stb_image.h 2021-05-05 23:15:41 +02:00
Jason C f5a31b70f5
Merge branch 'master' into patch-3 2021-05-05 16:24:46 -04:00
Jason C c2d3d22271
Fix crash in CanRead when file can not be opened.
Addresses #3849
2021-05-01 10:58:29 -04:00
contriteobserver 813b64ef52 corrected M3D_EXP_NOFACE test 2021-04-30 21:51:02 -07:00
contriteobserver e51bb1e77e fixed signed/unsigned mismatch warning 2021-04-30 21:26:57 -07:00
contriteobserver af0aca796e now compiling M3D ASCII support by default
addresses issue  #3777
2021-04-30 21:07:01 -07:00
Krishty b00de10eb3 Simplified importer search and fixed a few bugs
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.

Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity

Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
2021-04-24 00:17:50 +02:00
Krishty 196deea7ce added missing file extensions to aiImporterDesc::mFileExtensions 2021-04-23 15:05:09 +02:00
Kim Kulling 9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01:00
Guangmo Lin 2d4bc2d04e Eliminate maybe-uninitialized warnings which are treated as errors when use -DCMAKE_BUILD_TYPE=Release 2021-02-09 14:10:44 +08:00
Isuru2000psn f2b3ec2e0c strict-aliasing level 3 warnings fix 2020-10-05 15:29:09 +05:30
Sherief Farouk a3c8cfc0ff Fix for build break due to warnings-as-errors when not building M3D exporter. 2020-09-26 23:21:23 -07:00
Malcolm Tyrrell b7c789da67 Stop concatenating std::strings. Use formatter. 2020-08-18 17:35:08 +01:00
Rahul Sheth ad18e365e5 Fixing more warnings 2020-07-24 16:33:36 -04:00
Kim Kulling 76a6bb36f6
Merge branch 'master' into issue-3332_msvc2017 2020-07-20 22:04:35 +02:00
MeyerFabian 13ee2306c3 build/clang-cl-windows 2020-07-20 17:04:11 +02:00
RichardTea 9cad10a995 Disable MSVC warnings on all MSVC
Fixes the build on MSVC 2017 (and probably MSVC 2015)
2020-07-17 14:58:51 +01:00