fix coverity issue 54/317454/1 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen_unified_x_asan tizen accepted/tizen/unified/20250103.142713 accepted/tizen/unified/x/20250104.021612 accepted/tizen/unified/x/asan/20250113.002056
authorInki Dae <inki.dae@samsung.com>
Thu, 2 Jan 2025 06:51:45 +0000 (15:51 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 2 Jan 2025 07:22:30 +0000 (16:22 +0900)
Fix below coverity issues to unitialized variable by initializing all
members of inference_engine_tensor_info structure correctly.

CIDs : 1147940114801218250831826186 and 1828010

Change-Id: Ia213f2343bd867166f357cadd974bdd4a638e5ae
Signed-off-by: Inki Dae <inki.dae@samsung.com>
include/inference_engine_type.h

index 19cfc7a2c03dcc853660a6b284fcc5a603965b63..72f6d10b7f54aaa21444f60db6f097d27f5a9d9d 100644 (file)
@@ -221,12 +221,12 @@ extern "C"
         */
        typedef struct _inference_engine_tensor_info {
                std::vector<size_t> shape; /**< a tensor shape. */
-               inference_tensor_shape_type_e shape_type; /**< a tensor shape of the layer. */
-               inference_tensor_data_type_e data_type; /**< a tensor type of the layer. */
-               size_t size; /** tensor element size. The size should be height * width * channel count */
-               float scale; /**< a scale value of the layer. */
-               int zero_point; /**< a zero point value of the layer. */
-               inference_tensor_quantization_type_e quantization_type; /**< a quantization type of the layer. */
+               inference_tensor_shape_type_e shape_type { INFERENCE_TENSOR_SHAPE_NCHW }; /**< a tensor shape of the layer. */
+               inference_tensor_data_type_e data_type { INFERENCE_TENSOR_DATA_TYPE_NONE }; /**< a tensor type of the layer. */
+               size_t size {}; /** tensor element size. The size should be height * width * channel count */
+               float scale {}; /**< a scale value of the layer. */
+               int zero_point {}; /**< a zero point value of the layer. */
+               inference_tensor_quantization_type_e quantization_type { INFERENCE_TENSOR_QUANTIZATION_NONE }; /**< a quantization type of the layer. */
                // TODO.
        } inference_engine_tensor_info;