Sfoglia il codice sorgente

Fix UNKNOWN WRITE in std::__1::list<Assimp::LWO::Envelope, std::__1::allocator<Assimp::LWO::Envelope>

Alex 2 anni fa
parent
commit
dbd15fd351
1 ha cambiato i file con 9 aggiunte e 10 eliminazioni
  1. 9 10
      code/AssetLib/LWS/LWSLoader.cpp

+ 9 - 10
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\'");
-            }
-
-            // important: index of channel
-            nodes.back().channels.emplace_back();
-            LWO::Envelope &env = nodes.back().channels.back();
-
-            env.index = strtoul10(c);
+            } else {
+                // important: index of channel
+                nodes.back().channels.emplace_back();
+                LWO::Envelope &env = nodes.back().channels.back();
 
-            // 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);
+                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") {