Commit Graph

12746 Commits

Author SHA1 Message Date
Kim Kulling
fa18d3dde6 Fix possible overflow 2025-09-23 21:24:58 +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
Matt Penny
489c8d565b Restore merging of near-identical vertices for JoinIdenticalVertices (#6278)
* Restore merging of near-identical vertices for JoinIdenticalVertices

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-21 10:57:17 +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
fifth_light
5c568616ec Fix hasTangentsAndBitangents method in AiMesh.java (#6345)
original code m_tangents != null && m_tangents != null; triggers error prone

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-18 10:09:43 +02:00
AbdulRehman
45cb880835 Fixed Build.md (#6354)
* Fixed itch.io spelling from itchi.io
2025-09-18 09:34:55 +02:00
umläute
dd98d4aea3 PyAssimp: Re-add 'aiProcess_Triangulate' (#6335)
apparently, b9bfac0418 accidentally
removed a couple of lines with a botched copy'n'paste.

Co-authored-by: IOhannes m zmölnig <zmoelnig@umlautT.umlaeute.mur.at>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-17 10:23:37 +02:00
AbdulRehman
01ac320de8 Better README! Fixed discord link as well (#6351)
* Better README!
2025-09-17 08:16:38 +02:00
AbdulRehman
a815a78433 Updated doc/Preamble.txt & SECURITY.md (#6338)
* Update LICENSE

* Update Preamble.txt

* Update SECURITY.md

* Remove GitHub's default comment
2025-09-10 13:59:00 +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
Steven French
4c8a3bd39c [CMake] -l (#6329)
- Fix zlib linkage.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-04 09:32:37 +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
AbdulRehman
441884387f Update LICENSE (#6327) 2025-08-27 20:16:18 +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
Kyungjoon Ko
aadd49311a Fix OOB read in OpenDDLParser::parsePrimitiveDataType (#6315)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-25 15:03:00 +02:00
dependabot[bot]
3f107bebf2 Bump actions/download-artifact from 4 to 5 (#6319)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-22 20:26:58 +02:00
Sergei Trofimovich
a38ec50fd3 test/unit/utProfiler.cpp: fix gcc-16 build failure (#6267)
* test/unit/utProfiler.cpp: fix `gcc-16` build failure

Upcoming `gcc-16` improved detection of unused variables as:

    test/unit/utProfiler.cpp: In member function 'virtual void utProfiler_addRegion_success_Test::TestBody()':
    test/unit/utProfiler.cpp:71:22: error: variable 'j' set but not used [-Werror=unused-but-set-variable=]
       71 |         volatile int j=0;
          |                      ^

The change is intentional accoring to Andrew Pinsi and is not a faalse positive.

* Update utProfiler.cpp: Remove dead code

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-21 10:15:01 +02:00
Dongge Liu
4c42db1805 Fixed a heap-use-after-free in SortByPTypeProcess. (#6326)
The process incorrectly deleted original meshes from the scene when cleaning up after an error if those meshes had been added to its output list (outMeshes). The fix ensures proper ownership transfer by nullifying the original mesh pointer in the scene (pScene->mMeshes[i] = nullptr;) when the mesh is moved to outMeshes. This prevents the scene destructor from attempting to delete the mesh again later, while allowing the error cleanup path in SortByPTypeProcess to correctly delete all meshes it owns (both newly created and transferred originals).

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-21 09:31:15 +02:00
dependabot[bot]
26e2372882 Bump actions/checkout from 4 to 5 (#6328)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 12:50:30 +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
Kyungjoon Ko
3a0ee8792f Fix OOB read (2) in OpenDDLParser::parsePrimitiveDataType (#6316)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-14 13:51:07 +03:00
Kyungjoon Ko
e3f9cf5564 Fix OOB read in OpenDDLParser::parseReference (#6317)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-10 14:48:27 +03:00
Kyungjoon Ko
6d7ea78792 Fix SEGV write in Assimp::SortByPTypeProcess::Execute (#6318)
* Fix OOB Write in Assimp::SortByPTypeProcess::Execute
2025-08-10 11:45:30 +03:00
Dongge Liu
13316790aa Fixed a container-overflow error (#6298)
* Fixed a container-overflow error in `ODDLParser::OpenDDLParser::parseIntegerLiteral` by swapping the order of conditions in a while loop to ensure the end-of-buffer check happens before dereferencing the pointer. This prevents reading past the end of the buffer when lookForNextToken returns the end pointer.

https://oss-fuzz.com/testcase-detail/4980126616780800
https://issues.oss-fuzz.com/issues/42527625

* Update OpenDDLParser.cpp
2025-08-02 21:25:40 +02:00
Kim Kulling
9255412906 Add CMakePreset file (#6295)
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-07-30 13:53:21 +02: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
Panthuncia
edcb350129 Update Build.md (#6273)
Update build instructions to include information about USD importer special-case to ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT, and about ASSIMP_BUILD_USD_IMPORTER.
2025-07-22 21:08:33 +02:00
Kim Kulling
a79dc358cf Add windows clang to CI (#5537)
- Add windows clang build step
- Closes https://github.com/assimp/assimp/issues/5519


Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
Co-authored-by: Kim Kulling <kullingk@LDED5178.corp.draeger.global>
2025-07-16 16:43:20 +02:00
Kim Kulling
db0bde758e Update Readme.md (#6245) 2025-07-02 14:35:32 +02:00
Kim Kulling
b447485c06 Fix sonarcube findings (#6242)
* Fix sonarcube findings

* Fix review findings
2025-06-28 18:56:28 +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
HandsomeXi
4b6cc8c28a bugfix: Fixed the memory leak when texture transforming (#6236) (#6237)
* bugfix: Fixed the memory leak when texture transforming (#6236)

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-26 10:53:08 +02:00
Kim Kulling
d99f9bd2f7 Refactoring: Add nupptr-checks (#6241) 2025-06-26 00:09:02 +02:00
Kim Kulling
b2afe717d3 Update Importer.hpp (#6235)
- Add doc for out-of-memory exception
- closes https://github.com/assimp/assimp/issues/5173
2025-06-21 13:33:15 +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
Kim Kulling
fb375dd8c0 Prepare 6.0.2 (#6231) v6.0.2 2025-06-08 21:50:39 +02:00
sSsA01
a95addfc4a Fix the function "aiGetMaterialColor" when the flag ASSIMP_DOUBLE_PRECISION is enabled. (#6090)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-08 14:25:47 +02:00
Kim Kulling
2d8c09b60f Update SECURITY.md (#6230)
* Update SECURITY.md

* Update SECURITY.md
2025-06-08 14:14:24 +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
Kim Kulling
c1d6226c06 Update/update pugi xml (#6229)
* update pugixml

Improvements:

Many xml_attribute:: and xml_node:: functions now transparently support std::string_view and std::string when C++17 support is detected.
CMake improvements:

Improve pkg-config file generation for NixOS
PUGIXML_BUILD_APPLE_FRAMEWORK CMake option can be used to build pugixml as .xcframework
PUGIXML_INSTALL CMake option can be used to disable installation targets
Compatibility improvements:

Fix clang/gcc warnings -Wzero-as-null-pointer-constant, -Wuseless-cast, -Wshorten-64-to-32
Fix unreferenced function warnings in PUGIXML_NO_STL configuration
Fix CMake 3.31 deprecation warnings
Stop using deprecated throw() when noexcept is available

Improvements:

xml_attribute::set_name and xml_node::set_name now have overloads that accept pointer to non-null-terminated string and size
Implement parse_merge_pcdata parsing mode in which PCDATA contents is merged into a single node when original document had comments that were skipped during parsing
xml_document::load_file now returns a more consistent error status when given a path to a folder
Bug fixes:

Fix assertion in XPath number→string conversion when using non-English locales
Fix PUGIXML_STATIC_CRT CMake option to correctly select static CRT when using MSVC and recent CMake
Compatibility improvements:

Fix GCC 2.95/3.3 builds
Fix CMake 3.27 deprecation warnings
Fix XCode 14 sprintf deprecation warning when compiling in C++03 mode
Fix clang/gcc warnings -Wweak-vtables, -Wreserved-macro-identifier

* Update CMakeLists.txt

* pugixml: upgrade to v1.15

* pugixml: Add export directives for non-windows platforms

* pugixml: replace NULL by nullptr.

---------

Co-authored-by: Andrea <realeandrea@yahoo.it>
Co-authored-by: mosfet80 <10235105+mosfet80@users.noreply.github.com>
2025-06-08 02:12:05 +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