6563 Commits

Author SHA1 Message Date
Kim Kulling
ab0a119626 Update LimitBoneWeightsProcess.cpp
- Removing empty bones only if AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES is enabled.
- closes https://github.com/assimp/assimp/issues/4840
2023-01-20 19:14:04 +01:00
lsnoel
8d1256f472 Comments about winding order fix for gen normals 2023-01-20 14:55:06 +00:00
Kim Kulling
d331a7e5d4 Merge branch 'master' into fix-build-without-armaturepopulate-post-process 2023-01-20 13:52:13 +01:00
lsnoel
eb5d3c51e8 Correctly consider aiProcess_FlipWindingOrder AND aiProcess_MakeLeftHanded when generating normals 2023-01-19 16:46:29 +00:00
Krishty
72f360710a Fix MSVC Warnings With “emplace_back()”
Several places in the code call `std::vector<aiVector3D>.emplace_back(0, 0, 0)`. The constructor of `aiVector3D` actually expects arguments of the type `ai_real`, (alias of `float` if compiling without `ASSIMP_DOUBLE_PRECISION`) but the literal `0` is of type `int`.

`emplace_back()` does support promotion, but `int` to `float` is a potentially lossy conversion. tl;dr: On warning level 4, MSVC spits out a very deeply nested `warning C4244: 'argument': conversion from '_Ty' to 'TReal', possible loss of data with _Ty=int and TReal=ai_real`.
2023-01-18 00:08:38 +01:00
shimaowo
20acfeaf97 Merge branch 'master' into fix_gltf2_camera_fov 2023-01-17 14:39:54 -08:00
shimaowo
b298b79a46 add missing parens 2023-01-17 10:53:41 -08:00
Martin Mory
7f6e96747b Merge branch 'master' into f-FixWhitespaceBetweenTagAndNum 2023-01-17 13:32:39 +01:00
Martin Mory
a89d5c7cea Merge branch 'master' into f-FixWhitespaceBetweenTagAndNum 2023-01-17 12:10:46 +01:00
Kim Kulling
e9f95e5ab6 Merge branch 'master' into fix-build-with-m3d-import-only 2023-01-17 11:22:00 +01:00
Kim Kulling
19dec716d3 Merge branch 'master' into fixJoinVerticesProcess 2023-01-17 09:11:43 +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
43a062a5d7 Remove Stray Semicolon 2023-01-16 20:45:00 +01:00
shimaowo
39cbef1e21 Fix: fix incorrect math for calculating the horizontal FOV of a perspective camera in GLTF2 import #4435 2023-01-16 11:39:13 -08:00
Krishty
3d3e856925 Trim Trailing Whitespace 2023-01-16 09:12:35 +01:00
Krishty
793284a766 Fix Build Without ArmaturePopulate Post Process Step
This post process step introduced new attributes into `aiSkeletonBone`. Said attributes are only defined with the process enabled, i.e. when the `ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS` macro has not been defined.

Some code, however, accessed the variables unconditionally, leading to build failures if `ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS` was defined.

This commit adds the missing checks.
2023-01-16 08:42:50 +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
Krishty
bad76fd0f1 Replace Variables With Literals 2023-01-16 08:18:36 +01:00
Krishty
e5c02e8d45 Remove Useless “virtual”
These functions are already marked “override”, and their neighbors had “virtual” removed as well.
2023-01-16 08:12:24 +01:00
Martin Mory
43c0f8bb3d Remove whitespace between a <v> tag and the first number, otherwise first call to strtoul10() returns 0 and the indices are broken, leading to possible out-of-bound access and memory corruption/crash 2023-01-15 23:03:41 +01:00
Kim Kulling
2d37f49f51 Remove deprecated comment
- closes https://github.com/assimp/assimp/issues/4869
2023-01-15 19:12:24 +01:00
Daniel Rösner
74af523b3e Generalize JoinVerticesProcess for multiple UV and color channels 2023-01-12 13:13:46 +01:00
Kim Kulling
b393132b58 Merge branch 'master' into spelling 2023-01-08 17:43:55 +01:00
Kim Kulling
96b071bdb1 Fix: Fix possible division by zero
- closes https://github.com/assimp/assimp/issues/4860
2023-01-04 09:19:37 +01:00
Andy Maloney
e893248e7c Fix several spelling mistakes & a comment 2023-01-01 13:31:48 -05:00
Kim Kulling
a8e50be781 Refactoring: Move asserthandler header to include 2022-12-23 16:19:39 +01:00
Kim Kulling
376f66a06d Merge branch 'master' into master 2022-12-16 10:11:56 +01:00
Kim Kulling
c3d15a3f51 Fix minor review findings. 2022-12-16 09:03:40 +01:00
Kim Kulling
c92b84e38d Merge branch 'master' into patch-10 2022-12-16 09:00:41 +01:00
Kim Kulling
db8ff41679 Update MD5Parser.cpp 2022-12-15 14:06:57 +01:00
Kim Kulling
2612950b7b Merge branch 'master' into patch-9 2022-12-15 14:05:35 +01:00
sashashura
917352dd8b Fixes Heap-buffer-overflow READ 1 in Assimp::ObjFileParser::getFace
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49274
2022-12-11 01:54:57 +01:00
Alex
90769ef3e6 Fixes Heap-buffer-overflow READ 1 in Assimp::MD5::MD5Parser::ParseHeader
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49422
When it reaches the `SkipSpacesAndLineEnd`, `in` already points past `bufferEnd` and it leads to out of bounds memory read.
2022-12-11 00:02:09 +00:00
Alex
d5294be00b Fixes Heap-buffer-overflow READ 4 in Assimp::ScenePreprocessor::ProcessMesh
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49797
2022-12-10 01:22:00 +00:00
Umesh Rajesh Ramchandani
2d372b302f Fixed bug when exporting binary FBX
Fixed vector subscript out of range bug when NULL_RECORD is passed to PutString and is actually null
2022-12-08 14:59:25 +01:00
Kim Kulling
fec39154ed Merge branch 'master' into floatwarnings 2022-12-08 14:18:35 +01:00
Kim Kulling
769b47ed0e Ensure face pointer is not nullptr
- closes https://github.com/assimp/assimp/issues/4831
2022-12-08 09:35:11 +01:00
Kim Kulling
3f66b92797 Merge branch 'master' into master 2022-12-06 20:34:51 +01:00
Kim Kulling
9d57ac9cc5 Fix:Add missing semicolon. 2022-12-05 13:15:42 +01:00
Kim Kulling
81f85a6f93 Avoid undefined-shift in Assimp::ASE::Parser::ParseLV4MeshFace. 2022-12-05 13:07:52 +01:00
Gargaj
9c839f2d9a more fixes 2022-12-03 20:44:57 +01:00
Gargaj
07d4e83f43 fix warnings-as-errors for msvc x64 2022-12-03 20:27:00 +01:00
Kim Kulling
62486c6e7c FIX: Fix possible division by zero
- closes https://github.com/assimp/assimp/issues/4819
2022-12-02 09:24:51 +01:00
Kim Kulling
d8b9e2b64b Merge branch 'master' into master 2022-12-02 08:41:43 +01:00
Kim Kulling
f578b15759 Merge branch 'master' into explspec 2022-11-30 14:03:09 +01:00
Thomas Köppe
7d06d798af [BlenderDNA.h] Declare explicit specializations
It is an ODR violation to use a template specialization for which an
explicit specialization is defined somewhere whose declaration is not
visible at the point of use.

Found via clang's -Wundefined-func-template warning.
2022-11-29 18:38:33 +00:00
Adam Beili
54068637ee Merge branch 'master' into refactor/KHR_material_specular 2022-11-29 17:35:52 +01:00
Kim Kulling
8fb7ba3444 Merge branch 'master' into modernize-smartptrs-literals 2022-11-29 09:58:17 +01:00
naota29
ab82428bb5 Merge branch 'master' into master 2022-11-22 07:15:38 -08:00
Kim Kulling
5689ac7869 Add overfolow check for invalid data.
- closes https://github.com/assimp/assimp/issues/3422
2022-11-22 10:50:52 +01:00