浏览代码

Ensure we don't access the vector with an out of bounds index

Max Vollmer (Microsoft Havok) 3 年之前
父节点
当前提交
38382715f7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/AssetLib/glTF/glTFCommon.h

+ 1 - 1
code/AssetLib/glTF/glTFCommon.h

@@ -300,7 +300,7 @@ public:
 
     inline unsigned int GetIndex() const { return index; }
 
-    operator bool() const { return vector != 0; }
+    operator bool() const { return vector != nullptr && index < vector->size(); }
 
     T *operator->() { return (*vector)[index]; }