From 38382715f78d6b91c7e8db88cb002f80d92a56a8 Mon Sep 17 00:00:00 2001 From: "Max Vollmer (Microsoft Havok)" <60260460+ms-maxvollmer@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:01:00 +0000 Subject: [PATCH] Ensure we don't access the vector with an out of bounds index --- code/AssetLib/glTF/glTFCommon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF/glTFCommon.h b/code/AssetLib/glTF/glTFCommon.h index 78d40ce2c..14b82aa29 100644 --- a/code/AssetLib/glTF/glTFCommon.h +++ b/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]; }