Commit Graph

1595 Commits

Author SHA1 Message Date
Kim Kulling
e778c84cd6 MD5: Fix face index allocation in MD5Parser (#6380)
- Ensure face indices are properly allocated and resized.
- closes https://github.com/assimp/assimp/issues/6379
2025-10-24 10:15:01 +02:00
Kim Kulling
5f7c06a71e COB: fix validation for ascii header (#6376)
* COB: fix validation for ascii header
2025-10-23 22:44:54 +02:00
Kim Kulling
7dcf6a8984 Collada: Fix overflow in CopyVertex (#6374)
* Fix overflow in CopyVertex
2025-10-19 23:13:59 +02:00
Kim Kulling
cc6ab1408f Update texture output format in AssxmlFileWriter (#6372)
* Update texture output format in AssxmlFileWriter
2025-10-17 11:24:38 +02:00
Kim Kulling
f544f9c217 Bugfix/fix sonarcube findings (#6369)
* Fix sonarcube findings.
---------
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-10-14 00:01:50 +02:00
Kim Kulling
194da5b2fd Update default material name handling (#6366)
* Replace strcpy by strncpy
2025-10-07 20:25:24 +02:00
Kim Kulling
f28a96121d Change strcpy to strncpy for format hint safety (#6365) 2025-10-02 16:31:00 +02:00
Sami Liedes
1894bfb22c Fix an invalid offsetof warning-as-error (#6359)
The code already disables the warning on clang. It's also caused on
GCC in some circumstances (particularly when building with
-D_GLIBCXX_DEBUG).
2025-09-28 20:30:59 +02:00
Steve M
b8133b04c7 Clone meshlab/tinyusdz repos in default location (#6239)
* Leave FETCHCONTENT_BASE_DIR as default to avoid target platform generated build file conflicts

* Attempt address sonarCloud complaint about generic-looking include file (bare "Parser.h")

---------

Co-authored-by: tellypresence <info@tellypresence.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-23 11:34:13 +02:00
Paul Bauriegel
709fe3c3d0 Add BOM skip and fix mtl parsing (#6253)
* Add BOM skip and fix mtl parsing
* Remove old code
* Fix #5635
* Add all attributes to ObjFileData
---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-22 11:20:24 +02:00
Luca Della Vedova
0581ed5f11 Added tangent handedness to glTF export (#6322)
* Added tangent handedness to glTF export
2025-09-18 14:10:41 +02:00
Vitaly Ovchinnikov
69f8eb21fd fix large glb reading by providing a proper helper for reading size_t type (#6307)
Co-authored-by: Vitaly Ovchinnikov <v@ovch.ru>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-09 14:27:17 +02:00
Kim Kulling
72b9939b9f Add null check for aiNode in AddNode method (#6348)
- Added null check for node in AddNode function.
- closes https://github.com/assimp/assimp/issues/6347
2025-09-09 14:10:07 +02:00
Kim Kulling
8ef3838beb FBX: Fix offset calculation by adding cursor check (#6337)
- closes https://github.com/assimp/assimp/issues/6336
2025-08-28 11:48:38 +02:00
Pranav P
f7bbf6dc15 Fix endiannes issues regarding floats on s390x (#6276) (#6277)
* Fix endiannes issues regarding floats on s390x (#6276)

* Fix CI Warnings

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-26 15:34:33 +02:00
Dongge Liu
36b004e286 Fixed a heap-buffer-overflow in the Half-Life 1 MDL loader. (#6321)
The loader attempted to read the MDL header without verifying if the input buffer was large enough.
Added a check in MDLImporter::InternReadFile_HL1 to ensure the buffer size is sufficient before proceeding with loading.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-18 09:29:45 +03:00
sSsA01
8355e0c4bc Fix to fail in the function fast_atoreal_move when the flag ASSIMP_DOUBLE_PRESICION is enabled (#6250)
* Refix export fbx PolygonVertexIndex

* Fix the function ColladaParser::ReadEffectColor when the flag ASSIMP_DOUBLE_PRESICION is enabled

* Fix the static function ReadLight in ColladaParser when the flag ASSIMP_DOUBLE_PRESICION is enabled

* Refactor of the call of the function fast_atoreal_move to the member of aiColor3D

* Fix the call of the function fast_atoreal_move when the flag ASSIMP_DOUBLE_PRESICION is enabled and and refactor

* Fix the call of the function fast_atoreal_move when the flag ASSIMP_DOUBLE_PRESICION is enabled

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-07-29 14:19:50 +02:00
DIGITAL IMAGE DESIGN
6fa9d09a97 AC: Support Double-Sided Faces (#6252)
* AC: Support Double-Sided Faces

The AC format marks double-sided SURF elements with the 0x20 flag, which Assimp ignored. This commit adds support for double-sided faces.

On encountering a double-sided face via the flag mentioned above, the front face is generated as usual but is then duplicated. The winding order of the duplicate is flipped to form a back face. Vertices are duplicated too so that back faces work correctly with normal vector generation and face smoothing.

* Add test file

* Simplify test case

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-07-29 13:09:30 +02:00
Kim Kulling
9f4e7c6d8d Refactoring: use using types (#6266)
* Refactoring: use using types

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-07-28 17:00:45 +02:00
Kim Kulling
59bc03d931 X3D: Fix invalid vector::back usage (#6283)
* X3D: Fix invalid vector::back usage
2025-07-25 15:01:16 +02:00
sSsA01
4c61ca3af5 Refix export fbx PolygonVertexIndex (#6240)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-27 11:30:04 +02:00
NSG
ad6e8e210a Fix: export fbx wrong to_ktime in FBXExporter.cpp (#6105)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-17 08:23:21 +02:00
Vinz Spring
357b5baabb fix-CVE-2025-3158: closes #6023 Fixes CVE-2025-3158: Heap-based Buffer Overflow in Assimp::LWO::AnimResolver::UpdateAnimRangeSetup (#6222)
- changed loop-condition to reflect the fact that m must be smaller than n

Co-authored-by: Vinz Spring <vinzs@amazon.de>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-08 14:02:04 +02:00
Vinz Spring
269987085f Fixes CVE-2025-2750: out of bounds write by assigning to wrong array element count tracking (closes #6011) (#6225)
description:
- The current implementation has faulty reallocation logic when parsing a CSM file
- Issue 1
    - 4ad1d2aa30/code/AssetLib/CSM/CSMLoader.cpp (L205)
    - By assigning s->mNumPositionKeys = alloc*2 right before resizing the buffer, making s->mNumPositionKeys equivalent to the
      max number of aiVectorKey that can be stored in s->mPositionKeys
    - the code later attempts to get the next write location by doing: aiVectorKey* sub = s->mPositionKeys + s->mNumPositionKeys;
    - this points to the end of the array, not after the last element in the array
- Issue 2
    - 4ad1d2aa30/code/AssetLib/CSM/CSMLoader.cpp (L178-L184)
    - if the CSM file does not declare last frame data, then mPositionKeys will never be initialized

fix:
- we preserve s->mNumPositionKeys to still contain the actual number of aiVectorKeys and ensure that we will not write out of bounds
- we initialize mPositionKeys with a default value and if we find last frame info, we just re-initialize it

Co-authored-by: Vinz Spring <vinzs@amazon.de>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-08 13:46:39 +02:00
Vinz Spring
5be336779d Fixes CVE-2025-2757: Heap-based Buffer Overflow in AI_MD5_PARSE_STRING_IN_QUOTATION (closes #6019) (#6223)
description:
- heap buffer overflow in AI_MD5_PARSE_STRING_IN_QUOTATION. An attacker could potentially exploit the vulnerability to cause a remote code execution,
  if they can trick the victim into running assimp on a malformed MD5 file

fix:
- truncated the string to the maximum supported length, mitigating overflow

Co-authored-by: Vinz Spring <vinzs@amazon.de>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-08 13:38:05 +02:00
Vinz Spring
177797c77b Fixes CVE-2025-2751: Out-of-bounds Read in Assimp::CSMImporter::InternReadFile (closes #6012) (#6224)
description:
issue:
- 4ad1d2aa30/code/AssetLib/CSM/CSMLoader.cpp (L274C1-L275C1)
- sometimes the code tried to construct a new 4x4 matrix from a nullptr, thus reading out of bounds

fix:
- added nullptr check
- added array count check
- added default fallback init to identity matrix

Co-authored-by: Vinz Spring <vinzs@amazon.de>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-08 12:10:12 +02:00
Jackson Levitt
8621d52430 Updated Inner Cone formula for Spot Lights in GLTF (#6078)
Updated the Inner Cone formula such that exponent values of 0 result in no inner cone and large exponent values result in a inner cone being most of the cone angle-wise.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-05 09:41:30 +02:00
sSsA01
5d39661751 fix compile error caused by PR #6087 when ASSIMP_DOUBLE_PRESICION is enabled (#6091)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-05 09:15:47 +02:00
sSsA01
a98ffe6c6f Fix export fbx: Wrong Materials in LayerElementMaterial if a node contains multi meshes (#6103)
* fix export fbx wrong Materials index in LayerElementMaterial

* Refix export fbx wrong Materials index in LayerElementMaterial. Materials index should be the order of Materials in connections of the Model node.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-05 09:05:36 +02:00
NSG
c4515f53ca Fix: Add "preservePivots" condition when importing FBX animation (#6115)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-31 14:41:25 +02:00
Vinz Spring
7eb6b0c3db fix: closes #6069 CVE-2025-3196 (#6154)
* fix: closes #6069 CVE-2025-3196

* fix: updated patch for upstream symbol names

* fix: warning C4267

---------

Co-authored-by: Vinz Jarl Valentin Spring <vinzs@amazon.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Vinz Spring <contact@vinzspring.de>
2025-05-31 14:27:10 +02:00
sSsA01
7b38feb8a7 Fix export fbx PolygonVertexIndex (#6102)
* fix export fbx vertex index

* refactoring: remove unnecessary casts

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-31 13:49:58 +02:00
Steve M
4535ff9d6e Annotate w/C++17 "fallthrough" (#6143)
Co-authored-by: tellypresence <info@tellypresence.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-27 11:14:29 +02:00
Martin Mirchev
18465fbb24 Add clamping logic (#6149)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-26 10:16:10 +02:00
Kim Kulling
1933313ec8 Unreal refactorings (#6182)
* Unreal refactorings

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-16 14:18:37 +02:00
Julian Knodt
2c77d2555b [#5983] Fix bugs introduced in fbx export (#6000)
There were some typos and incorrect offsets in a previous PR. This fixes part of it, correctly exporting the UV.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-16 10:22:01 +02:00
Martin Mirchev
ed89a02fff Fix out-of-bounds dereferencing (#6150)
* Fix out-of-bounds dereferencing

* Fix: Add log error entry.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-16 09:07:04 +02:00
Xavier Bonaventura
64073458bd Fix warning abut inexistent warning (#6153)
These warnings are not existing before Visual Studio 2015

Fixes #6151

Co-authored-by: Xavier Bonaventura <xavier.bonaventura@gmail.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-13 20:37:42 +02:00
copycd
536cd59807 + Only up to recognizing the KTX2 compressed image as a texture object is handled. (#6139) 2025-05-08 21:28:30 +02:00
Kim Kulling
327afe0183 Fix crashes (#6138) 2025-05-07 23:40:53 +02:00
Kim Kulling
2056679e98 Fix: Support uint16 indices in OpenGEX as well (#6137)
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-07 10:15:54 +02:00
Qingyou Zhao
af352d6f7c Fix a bug where string erases throws out of range (#6135)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-05-06 23:33:28 +02:00
Kim Kulling
d1b73dffec Replace exception by error in log (#6133)
* Replace exception by error in log

* Separate tests for new behaviour

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-05 14:07:52 +02:00
Kim Kulling
0c02313893 Refactor (#6127)
* Refactor 3DS

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-03 11:46:10 +02:00
Kim Kulling
275eca9535 Bugfix: Handling no of texture coordinates correctly (#6124)
- If the mesh supports more than 2 texture coordinates this was not handled correctly. Now the code will be able to deal with 2 or 3 coords and throws an exception if this value gets invalid.
- closes https://github.com/assimp/assimp/issues/3829
2025-04-29 20:03:58 +02:00
yuri@FreeBSD
cb56793e16 fix: Fix build on armv6/armv7 (#6123) 2025-04-27 21:27:45 +02:00
sSsA01
ac5988422a Refactoring of PR #6092 (#6101)
* Fix fbx export. Nodes "LayerElementNormal" and "LayerElementColor" should be written only when actual data are exported.

* Update FBXExporter.cpp

- Fix intentions
- use empty instead of size for checking data exists

* refactoring

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-04-16 09:52:13 +02:00
Kim Kulling
4ee7b9d98d Use unique pointer to fix possible leak (#6104) 2025-04-15 21:51:05 +02:00
sSsA01
e68ea14f56 Not to export empty "LayerElementNormal" or "LayerElementColor" nodes to fbx (#6092)
* Fix fbx export. Nodes "LayerElementNormal" and "LayerElementColor" should be written only when actual data are exported.
2025-04-14 15:20:31 +02:00
Kim Kulling
2f3e72413f Bugfix/ensure collada parsing works issue 1488 (#6087)
* Add text to ensure that float parsing in colladata works right
2025-04-10 15:30:12 +02:00