[Tizen] Add log to prevent invalid access to array accepted/tizen/unified/20211123.143900 accepted/tizen/unified/20211125.003906 submit/tizen/20211122.105712 submit/tizen/20211123.152301
authordongsug.song <dongsug.song@samsung.com>
Mon, 22 Nov 2021 07:43:32 +0000 (16:43 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 22 Nov 2021 07:43:37 +0000 (16:43 +0900)
This reverts commit c9d2be20b8d1c85491c5813f491cc5382107affd.

Change-Id: I66d9509bd8f6dd3d2408e058cb3cf5bc1499c726

dali/internal/graphics/gles-impl/gles-context.cpp

index de5e058..9c21096 100644 (file)
@@ -864,6 +864,12 @@ void Context::ActiveTexture(uint32_t textureBindingIndex)
 void Context::BindTexture(GLenum target, BoundTextureType textureTypeId, uint32_t textureId)
 {
   uint32_t typeId = static_cast<uint32_t>(textureTypeId);
+  if(mImpl->mGlStateCache.mActiveTextureUnit >= MAX_TEXTURE_UNITS || typeId >= MAX_TEXTURE_TARGET)
+  {
+    DALI_LOG_ERROR("Invalid index (%d, %d)\n", mImpl->mGlStateCache.mActiveTextureUnit, typeId);
+    std::abort();
+  }
+
   if(mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] != textureId)
   {
     mImpl->mGlStateCache.mBoundTextureId[mImpl->mGlStateCache.mActiveTextureUnit][typeId] = textureId;