浏览代码

Fix integer overflow

Alex 2 年之前
父节点
当前提交
edb8375702
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      code/AssetLib/SMD/SMDLoader.cpp

+ 4 - 0
code/AssetLib/SMD/SMDLoader.cpp

@@ -840,6 +840,10 @@ void SMDImporter::ParseNodeInfo(const char* szCurrent, const char** szCurrentOut
         LogErrorNoThrow("Unexpected EOF/EOL while parsing bone index");
         SMDI_PARSE_RETURN;
     }
+    if (iBone == UINT_MAX) {
+        LogErrorNoThrow("Invalid bone number while parsing bone index");
+        SMDI_PARSE_RETURN;
+    }
     // add our bone to the list
     if (iBone >= asBones.size()) {
         asBones.resize(iBone+1);