[Tizen] Fix svace / coverity issues (no effects + size_t overflow + typo) 80/298280/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 5 Sep 2023 01:33:58 +0000 (10:33 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 5 Sep 2023 01:35:19 +0000 (10:35 +0900)
Change-Id: I87c8fd0040b212ab306469cf48040773f11e29ff
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-scene3d/internal/loader/gltf2-util.cpp
dali-scene3d/public-api/loader/bvh-loader.cpp
dali-scene3d/public-api/loader/scene-definition.cpp

index 2b954bd..16a7bf5 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/integration-api/debug.h>
+#include <limits> ///< for std::numeric_limits
 
 using namespace Dali::Scene3D::Loader;
 
@@ -301,6 +302,7 @@ std::vector<std::string_view> ReadMeshExtensionsTargetsName(const json_value_s&
 
     if(result.size() <= index)
     {
+      DALI_ASSERT_ALWAYS(index < std::numeric_limits<uint32_t>::max());
       result.resize(index + 1u);
     }
 
index 7bff27f..0c5922b 100644 (file)
@@ -181,7 +181,7 @@ bool ParseHierarchy(std::istream& file, std::shared_ptr<Joint>& joint)
         return false;
       }
     }
-    else if(line == TOKEN_OPENING_BRACE.data())
+    else if(token == TOKEN_OPENING_BRACE.data())
     {
       if(DALI_UNLIKELY(braceExist))
       {
index 370e926..6134f47 100644 (file)
@@ -383,7 +383,7 @@ void SceneDefinition::CountResourceRefs(Index iNode, const Customization::Choice
 
     void Register(ResourceType::Value type, Index id)
     {
-      if((!(*refCounts)[type].Empty()) && (id >= 0) && ((*refCounts)[type].Size() > id))
+      if((!(*refCounts)[type].Empty()) && ((*refCounts)[type].Size() > id))
       {
         ++(*refCounts)[type][id];
       }