From: huiyu.eun Date: Mon, 29 Nov 2021 07:55:26 +0000 (+0900) Subject: [Tizen] Add log to prevent invalid access to array X-Git-Tag: accepted/tizen/unified/20211129.212436^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=095b41c9c3c50f9bd287cd348da9d3e4d860014e;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [Tizen] Add log to prevent invalid access to array This reverts commit 7f3cda4d9af0fdbd4386c9a11fa5a425e8b4736e. Change-Id: I84fea3f0bf831436ece788e51978f1186876bbf2 --- diff --git a/dali/internal/graphics/gles-impl/gles-context.cpp b/dali/internal/graphics/gles-impl/gles-context.cpp index de5e058..9c21096 100644 --- a/dali/internal/graphics/gles-impl/gles-context.cpp +++ b/dali/internal/graphics/gles-impl/gles-context.cpp @@ -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(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;