From dbd15fd351cadbc140303e61e5a75d9e2d613bc9 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Jun 2023 16:44:18 +0000 Subject: [PATCH] Fix UNKNOWN WRITE in std::__1::list --- code/AssetLib/LWS/LWSLoader.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/code/AssetLib/LWS/LWSLoader.cpp b/code/AssetLib/LWS/LWSLoader.cpp index 9b243c4b6..c41ff9cac 100644 --- a/code/AssetLib/LWS/LWSLoader.cpp +++ b/code/AssetLib/LWS/LWSLoader.cpp @@ -632,18 +632,17 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy nodes.push_back(d); } ASSIMP_LOG_ERROR("LWS: Unexpected keyword: \'Channel\'"); + } else { + // important: index of channel + nodes.back().channels.emplace_back(); + LWO::Envelope &env = nodes.back().channels.back(); + + env.index = strtoul10(c); + + // currently we can just interpret the standard channels 0...9 + // (hack) assume that index-i yields the binary channel type from LWO + env.type = (LWO::EnvelopeType)(env.index + 1); } - - // important: index of channel - nodes.back().channels.emplace_back(); - LWO::Envelope &env = nodes.back().channels.back(); - - env.index = strtoul10(c); - - // currently we can just interpret the standard channels 0...9 - // (hack) assume that index-i yields the binary channel type from LWO - env.type = (LWO::EnvelopeType)(env.index + 1); - } // 'Envelope': a single animation channel else if ((*it).tokens[0] == "Envelope") {