浏览代码

Remove whitespace between a <v> tag and the first number, otherwise first call to strtoul10() returns 0 and the indices are broken, leading to possible out-of-bound access and memory corruption/crash

Martin Mory 2 年之前
父节点
当前提交
43c0f8bb3d
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      code/AssetLib/Collada/ColladaParser.cpp

+ 1 - 0
code/AssetLib/Collada/ColladaParser.cpp

@@ -762,6 +762,7 @@ void ColladaParser::ReadControllerWeights(XmlNode &node, Collada::Controller &pC
                 if (text == nullptr) {
                     throw DeadlyImportError("Out of data while reading <vertex_weights>");
                 }
+                SkipSpacesAndLineEnd(&text);
                 it->first = strtoul10(text, &text);
                 SkipSpacesAndLineEnd(&text);
                 if (*text == 0) {