Fix bugs 02/271502/2 accepted/tizen/unified/20220224.133659 submit/tizen/20220224.031004
authorTae-Young Chung <ty83.chung@samsung.com>
Tue, 22 Feb 2022 07:07:25 +0000 (16:07 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Tue, 22 Feb 2022 07:10:28 +0000 (16:10 +0900)
[Version] 0.4.1-0
[Issue type] Bug fix

1. Initialize member variables in class ctor
2. Fix usage after g_free()

Change-Id: Ib0a44d17801579596fec6c70fdc58cf00a596b9c
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
packaging/inference-engine-interface.spec
tools/include/InputMetadata.h
tools/include/OutputMetadata.h
tools/src/inference_engine_cltuner.cpp

index 8b37e62..c1545ba 100644 (file)
@@ -1,7 +1,7 @@
 Name:        inference-engine-interface
 Summary:     Interface of inference engines
-Version:     0.4.0
-Release:     1
+Version:     0.4.1
+Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0
 Source0:     %{name}-%{version}.tar.gz
index c894d34..9d4cffe 100644 (file)
@@ -80,7 +80,12 @@ namespace Cltuner
                inference_tensor_data_type_e dataType;
                inference_tensor_shape_type_e shapeType; // TODO: define mv_inference_shape_type_e
 
-               LayerInfo() = default;
+               LayerInfo() :
+                       name(),
+                       dims(),
+                       colorSpace(INFERENCE_COLORSPACE_INVALID),
+                       dataType(INFERENCE_TENSOR_DATA_TYPE_NONE),
+                       shapeType(INFERENCE_TENSOR_SHAPE_NCHW) {};
                ~LayerInfo() = default;
 
                int GetWidth() const;
index 92f4b85..7213ddf 100644 (file)
@@ -124,7 +124,10 @@ namespace Cltuner
                inference_box_decoding_type_e decodingType;
 
        public:
-               Label() = default;
+               Label() :
+                       name(),
+                       dimInfo(),
+                       decodingType(INFERENCE_BOX_DECODING_TYPE_SSD_ANCHOR) {};
                ~Label() = default;
                std::string GetName() { return name; }
                DimInfo GetDimInfo() { return dimInfo; }
@@ -139,7 +142,9 @@ namespace Cltuner
                DimInfo dimInfo;
 
        public:
-               Number() = default;
+               Number() :
+                       name(),
+                       dimInfo() {};
                ~Number() = default;
                std::string GetName() { return name; }
                DimInfo GetDimInfo() { return dimInfo; }
@@ -200,7 +205,10 @@ namespace Cltuner
                DimInfo dimInfo;
                int shapeType;
        public:
-               OffsetVec() = default;
+               OffsetVec() :
+                       name(),
+                       dimInfo(),
+                       shapeType(INFERENCE_TENSOR_SHAPE_NCHW) {};
                ~OffsetVec() = default;
                std::string GetName() { return name; }
                DimInfo GetDimInfo() { return dimInfo; }
index 368467d..678faf5 100644 (file)
@@ -503,10 +503,10 @@ static gboolean __interpret(char* cmd, char* cmd2)
                value = g_strsplit(cmd2, ".", 0);
                json_path = g_strdup_printf("%s.json", value[0]);
                model_paths.push_back(model_path);
-               g_free(model_path);
 
                LOGI("model_path : [%s]\n", model_path);
                LOGI("jsonfile path [%s] \n", json_path);
+               g_free(model_path);
                g_strfreev(value);
 
                res = ParseMetadata(metadata, std::string(json_path));