[Tizen] Add assertion to Vector 53/265253/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 13 Oct 2021 08:00:05 +0000 (17:00 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 13 Oct 2021 08:00:47 +0000 (17:00 +0900)
Change-Id: Ib09200441ee65bd75ed3394ee1525a6092808e34

dali/public-api/common/dali-vector.h

index fd4565e..1e8d230 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <assert.h>
 #include <algorithm>
 #include <cstddef>
 #include <cstdint> // uint32_t
@@ -549,6 +550,10 @@ public: // API
   {
     DALI_ASSERT_VECTOR(VectorBase::mData && "Vector is empty");
     DALI_ASSERT_VECTOR(index < VectorBase::Count() && "Index out of bounds");
+    if(index >= VectorBase::Count())
+    {
+      assert(0);
+    }
     ItemType* address = reinterpret_cast<ItemType*>(VectorBase::mData);
     address += index;
     return *address;