BUG: The fg::Parser::generateMeshIndices() function assignment accessor.count = positionAccessor.count; in line 895 is using stale data because the auto& accessor = asset.accessors.emplace_back(); changed the accessor vector and invalidates the previously read positionAccessor reference. In debug mode, all positionAccessor data becomes 0xdddddddd, which is a huge count and results in an allocation error when used later.
Error in fg::Parser::generateMeshIndices() when assigning accessor.count from dead positionAccessor.count data. Results in "bad allcoation" error when trying to allocate the given huge accessor.count data later. Repro: MSVS 2022 Debug 64 build. Load the file https://github.com/KhronosGroup/glTF-Sample-Models/blob/main/2.0/TriangleWithoutIndices/glTF/TriangleWithoutIndices.gltf with fastgltf::Options::GenerateMeshIndices enabled. I used these settings
BUG: The
fg::Parser::generateMeshIndices()
function assignmentaccessor.count = positionAccessor.count;
in line 895 is using stale data because theauto& accessor = asset.accessors.emplace_back();
changed the accessor vector and invalidates the previously readpositionAccessor
reference. In debug mode, all positionAccessor data becomes 0xdddddddd, which is a huge count and results in an allocation error when used later.