瀏覽代碼

glTFImporter: avoid out-of-bounds-access.

Kim Kulling 9 年之前
父節點
當前提交
c6f670ff50
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/glTFImporter.cpp

+ 1 - 1
code/glTFImporter.cpp

@@ -303,7 +303,7 @@ void glTFImporter::ImportMeshes(glTF::Asset& r)
                 attr.normal[0]->ExtractData(aim->mNormals);
             }
 
-            for (size_t tc = 0; tc < attr.texcoord.size() && tc <= AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) {
+            for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) {
                 attr.texcoord[tc]->ExtractData(aim->mTextureCoords[tc]);
                 aim->mNumUVComponents[tc] = attr.texcoord[tc]->GetNumComponents();