* 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>
* 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>
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>
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>
* 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/4980126616780800https://issues.oss-fuzz.com/issues/42527625
* Update OpenDDLParser.cpp
* 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>
* 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>
Update build instructions to include information about USD importer special-case to ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT, and about ASSIMP_BUILD_USD_IMPORTER.
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>
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>
* 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>
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>