Fix Coverity issues 15/255815/2
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 24 Mar 2021 04:41:36 +0000 (13:41 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 29 Mar 2021 07:27:17 +0000 (07:27 +0000)
Change-Id: I5a1bad11baf88116810fdd976fb882047f01f0da

dali-scene-loader/public-api/mesh-definition.cpp
dali-scene-loader/public-api/mesh-definition.h
dali-scene-loader/public-api/mesh-geometry.h

index 69292e2..8317803 100644 (file)
@@ -470,6 +470,11 @@ void MeshDefinition::Blob::ApplyMinMax(const std::vector<float>& min, const std:
                                                    value = std::min(std::max(min[i], value), max[i]);
                                                  });
 
+  if(!clampFn)
+  {
+    return;
+  }
+
   auto end = values + count * numComponents;
   while(values != end)
   {
index cd0ddc9..d03fa0b 100644 (file)
@@ -177,7 +177,7 @@ struct DALI_SCENE_LOADER_API MeshDefinition
     std::vector<uint16_t> mIndices;
     std::vector<Attrib>   mAttribs;
 
-    unsigned int        mBlendShapeBufferOffset;
+    unsigned int        mBlendShapeBufferOffset{0};
     Dali::Vector<float> mBlendShapeUnnormalizeFactor;
     PixelData           mBlendShapeData;
   };
index 026e9a7..5b46e0f 100644 (file)
@@ -33,7 +33,7 @@ struct DALI_SCENE_LOADER_API MeshGeometry
   Geometry      geometry;                    ///< The array of vertices.
   Texture       blendShapeGeometry;          ///< The array of vertices of the different blend shapes encoded inside a texture with power of two dimensions.
   Vector<float> blendShapeUnnormalizeFactor; ///< Factor used to unnormalize the geometry of the blend shape.
-  unsigned int  blendShapeBufferOffset;      ///< Offset used to calculate the start of each blend shape.
+  unsigned int  blendShapeBufferOffset{0};   ///< Offset used to calculate the start of each blend shape.
 };
 
 } // namespace SceneLoader