Commit Graph

12832 Commits

Author SHA1 Message Date
dependabot[bot]
b10b8ab99a Bump actions/upload-artifact from 6 to 7 (#6551)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  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>
2026-03-12 16:00:25 +01:00
Matthew Suozzo
b2852bc49b glTF2: Fix heap-buffer-overflow in GetVertexColorsForType (#6558)
The `GetVertexColorsForType` function previously used `input->count`
(the total number of elements in the accessor) to allocate the output
array and bound the conversion loop. However, when a
`vertexRemappingTable` is provided, `ExtractData` extracts a subset of
elements matching the size of the remapping table rather than the full
accessor count.

In cases where the remapping table was smaller than the accessor count
(including empty tables), the subsequent loop would perform
out-of-bounds reads on the `colors` buffer allocated by `ExtractData`.

This fix captures the actual number of elements extracted by
`ExtractData` and uses this value for the output allocation and loop
iteration, ensuring memory safety when vertex remapping is active.

Verified with ASan and existing unit tests.
2026-03-11 15:53:34 +01:00
Kim Kulling
e70199446d Refactor material system (#6563)
* Refactor material system

* Fix sonarqube finding
2026-03-08 23:40:09 +01:00
Kim Kulling
dc54c9fdea [Draft] Create AI Tool Use Policy for contributors (#6553)
Added a comprehensive AI Tool Use Policy outlining guidelines for contributors on using AI tools, ensuring human oversight and accountability in contributions.
- closes https://github.com/assimp/assimp/issues/6538
2026-03-08 21:27:08 +01:00
Kim Kulling
38f3e8d98b Add agents file. (#6562) 2026-03-07 00:42:53 +01:00
Steve M
8a073f7cb4 Apply codeRabbit suggested fix(es) from assimp PR #6548 (#6557)
Co-authored-by: tellypresence <info@tellypresence.com>
2026-03-06 12:44:08 +01:00
Kim Kulling
553fbc1fdb LWO: Fix negative iterator access, ptr was before begin (#6555) 2026-03-05 23:48:33 +01:00
dependabot[bot]
e13e0b5b7d Bump actions/download-artifact from 7 to 8 (#6550)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  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>
2026-03-02 20:16:21 +01:00
Kim Kulling
929bff1830 Ply: Fix ply triangle-strip parsing. (#6548) 2026-02-28 21:56:02 +01:00
EarendelArc
8ef1461cb8 glTF2: Preserve interpolation type and CubicSpline tangent data in animation keys (#6543)
fix(gltf2): preserve interpolation type and CubicSpline tangents

The glTF2 importer previously ignored the mInterpolation field and discarded
CubicSpline tangent data, leading to incorrect animation playback.

- Implement MapInterpolation() to map glTF2 interpolation types to Assimp.
- Set mInterpolation for all aiVectorKey and aiQuatKey instances.
- For CUBICSPLINE samplers, store [in-tangent, value, out-tangent] triplets
  (N x 3 keys) instead of discarding tangents.
- Fixes rendering consistency for InterpolationTest.glb where STEP, LINEAR,
  and CUBICSPLINE rows previously rendered identically.

Affected channels: mPositionKeys, mRotationKeys, mScalingKeys.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-26 15:33:03 +01:00
Kim Kulling
10be273aea Update supported version in SECURITY.md (#6459)
* Update supported version in SECURITY.md

- Preparation for bugfix release v6.0.5

* Update CMakeLists.txt

* Update aiGetVersionPatch test to expect version 5
2026-02-25 11:13:44 +01:00
Carter Rennick
3e672ff856 Fixed compiler error on platforms where unsigned int is not 32 bit (#6541)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-23 21:26:18 +01:00
Oliver Chang
3e188e6768 HL1MDLLoader: fix segfault in destructors (#6537)
In `HL1MDLLoader::read_animations`, the arrays for `scene_->mAnimations`
and `scene_animation->mChannels` were allocated using `new T*[count]`.
This performs default initialization, which leaves the pointer elements
with indeterminate (garbage) values.

If an exception (such as a `DeadlyImportError` from malformed input) is
thrown during the loop populating these arrays, the `aiScene` or
`aiAnimation` destructors are invoked during stack unwinding. These
destructors iterate through the allocated arrays and call `delete` on
each element. Because the arrays contained garbage values for indices
not yet reached by the loader, the destructor attempted to delete
invalid memory addresses, leading to a segmentation fault.

This patch changes the allocations to use value-initialization (`new
T*[count]()`), ensuring all pointers are initialized to `nullptr`. Since
`delete nullptr` is a safe no-op, the destructors can now safely clean
up partially initialized objects during an exception.

Fixes: https://issues.oss-fuzz.com/issues/483188619

Co-authored-by: CodeMender <codemender-patching@google.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-22 21:27:05 +01:00
Bill Wendling
21607dfb75 Obj: Fix heap-buffer-overflow in getFace via vertical tabs (#6540)
The `ObjFileParser::getFace` method failed to recognize the vertical tab
character (`\v`, 0x0b) as a separator. While the `IsSpaceOrNewLine`
utility handles most whitespace (space, tab, CR, LF, FF), it excludes
`\v`.

When encountering a vertical tab, the parser fell through to an `else`
block that calls `::atoi(&(*m_DataIt))`. Because `atoi` treats `\v` as
whitespace per the C standard, it skips the character and continues
reading. If `\v` is located at the end of the buffer (e.g., followed by
a newline at the buffer boundary), `atoi` can read past the allocated
memory, triggering a heap-buffer-overflow.

This fix explicitly checks for `\v` and treats it as a separator,
resetting the position counter and preventing the invalid `atoi` call.

Verified with AddressSanitizer and confirmed that all 584 existing unit
tests pass.

Fixes: https://issues.oss-fuzz.com/issues/476180586

Signed-off-by: Bill Wendling <morbo@google.com>
Co-authored-by: Meder Kydyraliev <meder@google.com>
Co-authored-by: CodeMender <codemender-patching@google.com>
2026-02-21 19:19:02 +01:00
Oliver Chang
970f8691dd FBXExporter: Fix stack-use-after-scope in WriteObjects (#6472)
The FBX exporter was unconditionally dereferencing a map iterator (`tp_elem`)
even when the key was not found (i.e., `tp_elem == tpath_by_image.end()`).
This resulted in a stack-use-after-scope error when accessing `tp_elem->second`
to populate "FileName" and "RelativeFilename" nodes, as dereferencing the
end iterator of the map accessed invalid stack memory (the map's sentinel).

The code already correctly initialized a local `tfile_path` variable based
on whether the iterator was valid. This patch updates the `AddChild` calls
to use `tfile_path` instead of dereferencing the potentially invalid iterator.


Fixes: https://issues.oss-fuzz.com/issues/465494996

Co-authored-by: CodeMender <codemender-patching@google.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-17 19:16:53 +01:00
Oliver Chang
8acd2c964e glTF2: Fix heap-buffer-overflow in Accessor validation and size calculation (#6473)
* glTF2: Fix heap-buffer-overflow in Accessor validation and size calculation

This patch fixes a heap-buffer-overflow in
`glTF2::Accessor::ExtractData` caused by incorrect bounds validation and
available size reporting.

The vulnerability stemmed from two issues in `glTF2Asset.inl`:

1.  **Underestimated validation in `Accessor::Read`**: The logic used
    `GetBytesPerComponent() * count` to validate the required buffer
    size. This failed to account for the actual `stride`, allowing
    accessors to pass validation even if their total footprint
    (including stride) exceeded the buffer view.
2.  **Incorrect size reporting in `Accessor::GetMaxByteSize`**: The
    function returned the total `bufferView->byteLength` while ignoring
    the `byteOffset`. Since the accessor data starts at `byteOffset`,
    the actual available space is `byteLength - byteOffset`. This led
    `ExtractData` to permit reads that extended beyond the end of the
    allocated buffer.

Changes:
*   Modified `Accessor::Read` to use `GetStride() * count` for length
    validation.
*   Updated `Accessor::GetMaxByteSize` to correctly return
    `bufferView->byteLength - byteOffset` for standard accessors and
    `sparse->data.size()` for sparse accessors.

Co-authored-by: CodeMender <codemender-patching@google.com>
Fixes: https://issues.oss-fuzz.com/issues/483102963

* address comment

---------

Co-authored-by: CodeMender <codemender-patching@google.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-17 10:57:40 +01:00
ZhangJY
b4c7912d21 Fix heap-buffer-overflow in OpenGEXImporter::handleIndexArrayNode() (#6470)
The mColors[0] array was allocated with m_numColors elements but
indexed up to mNumVertices (= numFaces * 3), causing an out-of-bounds
write when the color count is less than the vertex count.

Allocate mColors[0] with mNumVertices (matching mNormals and
mTextureCoords), and add a bounds check on idx before reading
from the source color array.

Fixes #6468

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-10 23:19:12 +01:00
Kim Kulling
e38451ff6c Add developer quickstart section to Readme (#6474)
* Add developer quickstart section to Readme

-Added a quickstart guide for developers to clone and build the project.
- closes https://github.com/assimp/assimp/issues/6469

* Change headings from H3 to H2 in Readme.md
2026-02-10 20:26:07 +01:00
Kyungjoon Ko
36c3a19aa8 Fix invalid verifying in OpenDDLParser::parseStringLiteral (#6314)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-02-06 13:34:23 +01:00
peng
5c5ae38934 LWO: Fix heap buffer overflow in LWOImporter::GetS0 (#6451)
* LWO: Fix heap buffer overflow in LWOImporter::GetS0
* Add strict buffer boundary checks to prevent out-of-bounds reads on malformed or unterminated strings.
Fixes #6169 (CVE-2025-5167)
2026-02-03 19:21:06 +01:00
peng
18798f150d MDL: Fix heap buffer overflow in MDLImporter frame parsing (#6456)
Add buffer boundary checks before reading frame data to prevent out-of-bounds reads on malformed MDL files.
Fixes #6172 (CVE-2025-5200)

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-01-29 21:10:18 +01:00
peng
ae6633ef8a Fix AC3DImporter heap-buffer-overflow by validating mesh vertex bounds (#6458)
Add validations check in AC3DImporter::ConvertObjectSection to ensure that writing TriangleStrip vertex data does not exceed mesh->mNumVertices allocation.
Fixes #6015 (CVE-2025-2754)
Fixes #6018 (CVE-2025-2756)

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
2026-01-28 21:33:55 +01:00
Kim Kulling
e0b52347c6 Update copyright year and project version (#6454)
* Update copyright year and project version

- Fixes version in lib

* Update copyright year to 2026

* Update copyright year to 2026 in Version.cpp

* Update copyright year and version patch test

* Fix copyright year

* Adapt copyrights
v6.0.4
2026-01-24 21:57:37 +01:00
Nicky Kitchingman
d5091bbb71 Fix some recently implemented comparisons of token strings (#6452)
* Fix some recently implemented comparisons of token strings. Previously, the `keyword` included the following space along with the token, which broke the string comparison using the equality operator.

* Rename `getEndOfToken` -> `getNextDelimiter`, to reflect the actual usage
2026-01-22 11:34:08 +01:00
peng
cf7b652190 MD3: Fix MD3Importer surface header bounds checks to prevent heap overflow (#6441)
Improve bounds checks in MD3Importer::ValidateSurfaceHeaderOffsets to prevent pcSurf from accessing data outside the MD3 buffer (fixes #6070, CVE-2025-3549).

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
v6.0.3
2026-01-20 00:29:27 +01:00
tyler92
129c1333e6 MDL/HL1: bounds-checked buffers and safer parsing (#6445) 2026-01-19 21:25:09 +01:00
peng
d1e6bcff6b MDC: Fix MDCImporter surface header bounds and endianness checks (#6440)
- Validate ulOffsetEnd in MDCImporter::ValidateSurfaceHeader to
  prevent pcSurface2 from moving past the MDC buffer(fixes #6167, CVE-2025-5165).
- Apply AI_SWAP4 to ulOffsetShaders before using it in bounds checks.

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-01-15 13:23:54 +01:00
Vitaly Ovchinnikov
d8a9074cd0 OBJ: avoid extra scanning while reading faces in ObjFileParser.cpp (#6281)
* obj: avoid extra scanning while reading faces

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-01-14 16:43:36 +01:00
tyler92
1ce99b9cf7 MD5: Fix uninitialized pointer dereference for file with invalid vertex index (#6439)
A segmentation fault occurred while parsing an MD5 file that contains an invalid vertex index.
The issue was caused by mScene->mMaterials not being kept in sync with mScene->mNumMaterials.
As a result, the aiScene destructor could call delete on uninitialized pointers. This patch
ensures that mScene->mNumMaterials always matches the actual contents of the mScene->mMaterials
array. That way, if an exception is thrown during file import, delete is only called for
properly allocated aiMaterial objects.
2026-01-12 15:08:31 +01:00
LP
522c703bb9 fuzz: Fix memory leak in ForceFormat helper (#6435)
The ForceFormat function unregisters importers from the Importer
but doesn't delete them, causing memory leaks detected by ASan
during OSS-Fuzz check_build.

When UnregisterLoader is called, the importer is removed from the
internal list but the memory is not freed. Since the Importer
originally allocated these objects and we're removing them from
its management, we must delete them explicitly.

Also include BaseImporter.h to ensure complete type information
is available for proper deletion.

This fixes OSS-Fuzz check_build failures for all format-specific
fuzzers (obj, gltf, glb, fbx, collada, stl).
2026-01-09 11:02:21 +01:00
peng
17318b02cf MDC: Fix heap OOB read by validating vertex buffer boundaries (#6168) (#6438)
- Add explicit boundary checks for pcVerts and pcCVerts arrays in MDCImporter.
- Prevents heap out-of-bounds reads with malformed or truncated files.
- Fixes CVE-2025-5166.

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
2026-01-09 08:59:22 +01:00
peng
ac8eac60a5 MDL: Fix synctype validation in MDLImporter to prevent OOB (#6437)
* MDL: Validate synctype > 0 in MDL 3/4/5 loader to prevent OOB access (#6170)

Signed-off-by: mapengyuan <mapengyuan@xfusion.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2026-01-07 10:50:12 +01:00
Kim Kulling
c234aa28c6 Add CHANGES.md file (#6436) 2026-01-03 22:32:33 +01:00
LP
ae6f477604 Fuzzing: Add OSS-Fuzz integration and multiple format-specific fuzzers (#6429)
* fuzz: Add OSS-Fuzz integration and multiple format-specific fuzzers

* fuzz: Add GLB fuzzer and fix null pointer issue

- Add null check for mFileExtensions in ForceFormat() to prevent
  undefined behavior when the field is null
- Fix misleading comment in gltf fuzzer (only covers text format)
- Add separate GLB fuzzer for binary glTF format coverage
- Update OSS-Fuzz build script to include GLB fuzzer with corpus

* Add copyright and licensing information

Added licensing information and copyright notice to fuzzer_common.h

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-12-23 19:31:27 +01:00
hankarun
0fb7c4a439 Feature: Add EXT_texture_webp extension to glb importer (#6431)
* Add EXT_texture_webp extension texture read for glb file format.
2025-12-22 12:44:18 +01:00
ljgdsq
8c0ab23470 Fix UTF-8 flag check in CMakeLists.txt (#6432) 2025-12-21 18:19:10 +01:00
Kim Kulling
f4980c455c Test against possible nullptr dereferencing (#6430)
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-12-18 11:26:13 +01:00
dependabot[bot]
c58496185d Bump actions/cache from 4 to 5 (#6425)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  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-12-16 12:56:08 +01:00
dependabot[bot]
a438bbb271 Bump actions/upload-artifact from 5 to 6 (#6426)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  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-12-16 11:43:03 +01:00
dependabot[bot]
0373bbede8 Bump actions/download-artifact from 6 to 7 (#6427)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  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-12-16 11:22:14 +01:00
Kim Kulling
c0b8cfaf41 Add closing brace to CMakePresets.json (#6424)
* Add closing braces to CMakePresets.json
2025-12-14 10:38:31 +01:00
Kim Kulling
5245511f1d Add new CMake preset for static build with double precision (#6414)
- Add static build preset
- Add build all preset
2025-12-13 09:58:49 +01:00
Matt Penny
e3b13a48a9 Fix incorrect FBX connection order (#6421)
PR #6120 fixed a macro which previously prevented std::unordered_multimap
from being used during FBX import when compiled with GCC.

This caused FBX::Element properties to be stored in arbitrary order,
but the order of connections ("C" properties) in FBX files matters.
The main issue I saw was incorrect materials.

This changes the type of FBX::ElementMap to always use std::multimap
(i.e., ordered). This was the behavior for years under GCC while the
broken macro was in use. Unordered containers are still used elsewhere
in the FBX importer to benefit from their performance.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-12-11 21:42:45 +01:00
Kim Kulling
9481ce8db9 Delete tools/coverity/assimp_modeling.cpp (#6422) 2025-12-10 16:38:09 +01:00
Kim Kulling
3761ee65c2 Update project details in Doxyfile (#6420) 2025-12-10 08:52:46 +01:00
Kim Kulling
75386282c1 Delete cmake-modules/FindDevIL.cmake (#6418) 2025-12-10 00:03:00 +01:00
Kim Kulling
c087c20e8b Update stb_image.h to version 2.30 (#6419) 2025-12-09 23:52:34 +01:00
Kim Kulling
7d1fa60aa3 Implement overflow check in Q3DLoader (#6417)
* Implement overflow check in Q3DLoader
2025-12-09 23:28:44 +01:00
Kim Kulling
6ef6d84a7e Revert buggy PR (#6415)
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-12-09 20:57:36 +01:00
Paul Zander
4d197881ff Only build collada test when importer/exporter is build (#6411)
See-also: https://bugs.gentoo.org/962559

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
2025-12-05 19:57:44 +01:00