Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[TF FE] Fix coverity issues to avoid uninitialized vars (#27880)

Roman Kazantsev9e9a70bc158c
diff --git a/src/frontends/tensorflow/src/checkpoint_v1_reader.cpp b/src/frontends/tensorflow/src/checkpoint_v1_reader.cpp
index d506759fd33..dab130cb381 100644
--- a/src/frontends/tensorflow/src/checkpoint_v1_reader.cpp
+++ b/src/frontends/tensorflow/src/checkpoint_v1_reader.cpp
@@ -254,7 +254,7 @@ void CheckpointV1Reader::read_variable(const std::string& variable_name, ov::Any
// This is only present at the first item of each checkpoint file and serves
// as a table of contents, listing all the tensor slices saved in this file.
- ::tensorflow::SavedTensorSlices sts;
+ ::tensorflow::SavedTensorSlices sts{};
FRONT_END_GENERAL_CHECK(sts.ParseFromArray(raw_data.data(), static_cast<int>(raw_data.size())),
"[TensorFlow Frontend] incorrect input checkpoint file or internal error: cannot parse "
"SavedTensorSlices entry");
diff --git a/src/frontends/tensorflow/src/op/var_handle.cpp b/src/frontends/tensorflow/src/op/var_handle.cpp
index f0077ae206b..53fdf21d608 100644
--- a/src/frontends/tensorflow/src/op/var_handle.cpp
+++ b/src/frontends/tensorflow/src/op/var_handle.cpp
@@ -98,7 +98,7 @@ OutputVector translate_varhandle_op(const NodeContext& node) {
TENSORFLOW_OP_VALIDATION(node, result, "[TensorFlow Frontend] Internal error: Cannot find requested variable.");
- ::tensorflow::BundleEntryProto entry;
+ ::tensorflow::BundleEntryProto entry{};
TENSORFLOW_OP_VALIDATION(node,
entry.ParseFromArray(entry_data, static_cast<int>(entry_size)),
"[TensorFlow Frontend] Internal error: Cannot get read bundle entry.");
diff --git a/src/frontends/tensorflow/src/op/xla_conv_v2.cpp b/src/frontends/tensorflow/src/op/xla_conv_v2.cpp
index a01780d58cf..795f4deb3d9 100644
--- a/src/frontends/tensorflow/src/op/xla_conv_v2.cpp
+++ b/src/frontends/tensorflow/src/op/xla_conv_v2.cpp
@@ -111,7 +111,7 @@ OutputVector translate_xla_conv_v2_op(const NodeContext& node) {
is_all_one,
"[TensorFlow Frontend] internal error: convolutional kernel with holes is not supported");
- ConvolutionDimensionNumbers dimension_numbers;
+ ConvolutionDimensionNumbers dimension_numbers{};
TENSORFLOW_OP_VALIDATION(
node,
dimension_numbers.ParseFromArray(dimension_numbers_message.data(),
diff --git a/src/frontends/tensorflow/src/variables_index.cpp b/src/frontends/tensorflow/src/variables_index.cpp
index 778f8b2f94b..f4e330518e2 100644
--- a/src/frontends/tensorflow/src/variables_index.cpp
+++ b/src/frontends/tensorflow/src/variables_index.cpp
@@ -128,7 +128,7 @@ void VariablesIndex::read_bundle_header() {
auto item = m_variables_index.find("");
FRONT_END_GENERAL_CHECK(item != m_variables_index.end(), "Bundle Header isn't found in index");
- ::tensorflow::BundleHeaderProto bundleHeader;
+ ::tensorflow::BundleHeaderProto bundleHeader{};
FRONT_END_GENERAL_CHECK(bundleHeader.ParseFromArray(item->second.data(), static_cast<int>(item->second.size())),
"Bundle Header: Cannot parse Bundle Header");
FRONT_END_GENERAL_CHECK(bundleHeader.version().producer() == 1, "Bundle Header: Unsupported producer version");
@@ -147,7 +147,7 @@ void VariablesIndex::read_checkpointable_object_graph() {
return;
}
- ::tensorflow::BundleEntryProto entry;
+ ::tensorflow::BundleEntryProto entry{};
FRONT_END_GENERAL_CHECK(entry.ParseFromArray(item->second.data(), static_cast<int>(item->second.size())),
"CMO: Cannot parse Bundle Entry");