Просмотр исходного кода

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

Max Vollmer (Microsoft Havok) 3 лет назад
Родитель
Сommit
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; }
     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]; }
     T *operator->() { return (*vector)[index]; }