Commit Graph

20 Commits

Author SHA1 Message Date
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
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
2026-01-24 21:57:37 +01:00
tyler92
129c1333e6 MDL/HL1: bounds-checked buffers and safer parsing (#6445) 2026-01-19 21:25:09 +01:00
Kim Kulling
45898eee55 Refactorings: glTF cleanups (#6028) 2025-03-05 21:37:47 +01:00
Kim Kulling
01231d0e60 Add 2024 to copyright infos (#5475) 2024-02-23 22:30:05 +01:00
Marc-Antoine Lortie
eb3b48e523 Invert logic in build_bone_children_hierarchy. 2023-03-14 09:21:45 -04:00
Marc-Antoine Lortie
054dacd068 Improved comments. 2023-03-13 19:07:14 -04:00
Marc-Antoine Lortie
4b4cb55f22 Fix HL1MDLLoader flattened bone hierarchy. 2023-03-13 19:06:18 -04:00
Kim Kulling
50c7301a38 Update copyrights 2022-01-10 21:13:43 +01: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
Malcolm Tyrrell
4ec01cfdcd Improve use of logging 2021-05-13 12:05:31 +01:00
Kim Kulling
8013c5011c Merge branch 'master' into hl1mdlOrient 2021-05-12 08:21:40 +02:00
Garux
4798ff3882 fix hl1 mdl orientation, tex coords, face windings order 2021-04-29 20:50:50 +03:00
Krishty
e6a47d93c2 removed dead code from 0d29203e24 2021-04-24 13:29:15 +02:00
contriteobserver
111752cff0 workaround for ASSIMP_DOUBLE_PRECISION compile errors
changed float types to ai_real types as needed

addresses issue #3682
2021-02-28 14:45:39 -08:00
Kim Kulling
9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01: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
kimkulling
9aa468262f closes https://github.com/assimp/assimp/issues/3252: fix build. 2020-07-07 17:35:03 +02:00
Marc-Antoine Lortie
03340787ec Fixed variable in loop - HL1MDLLoader.cpp
Commit 7e5a0acc48 made changes to HL1MDLLoader.cpp. Several variables have been renamed. A loop variable 'i' was renamed to faceIdx, but one reference was left unchanged.
2020-06-29 07:50:51 -04:00
Kim Kulling
f8e6512a63 Move format importer and exporter into its won folder. 2020-05-02 15:14:38 +02:00