浏览代码

Merge pull request #4836 from sashashura/patch-8

Fixes Heap-buffer-overflow READ 4 in Assimp::ScenePreprocessor::ProcssMesh
Kim Kulling 2 年之前
父节点
当前提交
ee02c389ca
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      code/AssetLib/OFF/OFFLoader.cpp

+ 4 - 3
code/AssetLib/OFF/OFFLoader.cpp

@@ -290,11 +290,12 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
         sz = line; SkipSpaces(&sz);
         sz = line; SkipSpaces(&sz);
         idx = strtoul10(sz,&sz);
         idx = strtoul10(sz,&sz);
         if(!idx || idx > 9) {
         if(!idx || idx > 9) {
-	    ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed");
+	        ASSIMP_LOG_ERROR("OFF: Faces with zero indices aren't allowed");
             --mesh->mNumFaces;
             --mesh->mNumFaces;
+            ++i;
             continue;
             continue;
-	}
-	faces->mNumIndices = idx;
+	    }
+	    faces->mNumIndices = idx;
         faces->mIndices = new unsigned int[faces->mNumIndices];
         faces->mIndices = new unsigned int[faces->mNumIndices];
         for (unsigned int m = 0; m < faces->mNumIndices;++m) {
         for (unsigned int m = 0; m < faces->mNumIndices;++m) {
             SkipSpaces(&sz);
             SkipSpaces(&sz);