summaryrefslogtreecommitdiffstats
path: root/code/AssetLib/CSM/CSMLoader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix to fail in the function fast_atoreal_move when the flag ↵sSsA012025-07-291-4/+4
| | | | | | | | | | | | | | | | | | | 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>
* Fixes CVE-2025-2750: out of bounds write by assigning to wrong array element ↵Vinz Spring2025-06-081-1/+9
| | | | | | | | | | | | | | | | | | | | | | count tracking (closes #6011) (#6225) description: - The current implementation has faulty reallocation logic when parsing a CSM file - Issue 1 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/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 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/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>
* Fixes CVE-2025-2751: Out-of-bounds Read in ↵Vinz Spring2025-06-081-1/+7
| | | | | | | | | | | | | | | | Assimp::CSMImporter::InternReadFile (closes #6012) (#6224) description: issue: - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/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>
* Fix crashes (#6138)Kim Kulling2025-05-071-2/+3
|
* Refactor (#6127)Kim Kulling2025-05-031-2/+3
| | | | | | | * Refactor 3DS --------- Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
* CMS: Fix possible overflow access (#6052)Kim Kulling2025-03-131-1/+1
| | | - closes https://github.com/assimp/assimp/issues/6010
* Refactorings: glTF cleanups (#6028)Kim Kulling2025-03-051-1/+1
|
* Bugfix/cosmetic code cleanup (#5947)Kim Kulling2025-01-071-8/+4
| | | | | | | | | * Refactorings: Code cleanups * More cosmetic changes --------- Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
* Add 2024 to copyright infos (#5475)Kim Kulling2024-02-231-1/+1
|
* Add bounds checks to the parsing utilities. (#5421)Kim Kulling2024-01-301-38/+39
| | | | | | | | | | | | | | | | | | | | | * Add bounds checks to the parsing utilities. * Fix merge conflicts in ACLoader. * Fix loaders * Fix unittest of AC-Loader. * Remove dead code. * Md5Parser fixes * Fix md5-parsing * Fix Merge conflict * Fix merge conflicts. * Md5: Fix warning: missing return statement.
* Refactoring: Some cleanupsKim Kulling2023-11-121-11/+4
|
* Apply various clang-tidy checks for smartprs and modern C++ typesAaron Gokaslan2022-11-081-4/+4
|
* Explicitly default all empty dtorsAaron Gokaslan2022-08-251-2/+1
|
* Merge branch 'new-file-detection' of https://github.com/krishty/assimp into ↵Kim Kulling2022-01-161-12/+3
|\ | | | | | | krishty-new-file-detection
| * replaced std::size() with AI_COUNT_OF for pre-C++20 compilersKrishty2021-05-051-1/+1
| |
| * Simplified importer search and fixed a few bugsKrishty2021-04-241-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension: 1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`. 2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer. Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations. Further bugfixes: - fixed glTF2 importer throwing exceptions when checking whether it can load a file - removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
* | Update copyrightsKim Kulling2022-01-101-1/+1
| |
* | more const in format detectionKrishty2021-09-111-1/+1
|/ | | | | | BaseImporter::SearchFileHeaderForToken() expected a pointer to a non-const token list. This was probably an oversight, as nobody would realistically expect the function to change the list. Furthermore, it prevented token lists from being compiled to read-only memory, in some cases even causing the compiler to generate thread-safe initialization. The list is now const and all callers declare their token lists static const, thus compiling them to read-only memory.
* Update copyrights to 2021.Kim Kulling2021-02-281-1/+1
|
* Stop concatenating std::strings. Use formatter.Malcolm Tyrrell2020-08-181-1/+1
|
* replace NULL and avoid ai_assert with more than 2 tests.Kim Kulling2020-06-231-1/+1
|
* Move format importer and exporter into its won folder.Kim Kulling2020-05-021-0/+308