Skip to content

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

[test] add read_model fuzzers for pytorch and tf models (#36753)

jszczepa22de1ea95a5b
diff --git a/tests/fuzz/src/read_model_tensorflow-fuzzer.cc b/tests/fuzz/src/read_model_tensorflow-fuzzer.cc
new file mode 100644
index 00000000000..55cee880034
--- /dev/null
+++ b/tests/fuzz/src/read_model_tensorflow-fuzzer.cc
@@ -0,0 +1,21 @@
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+#include "openvino/openvino.hpp"
+#include "fuzz-utils.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ ov::Core core;
+ try {
+ const auto model_file = create_model_file(data, size, ".pb");
+ ScopedRemove cleanup{model_file};
+
+ if (const auto model = core.read_model(model_file); model) {
+ model->get_name();
+ model->outputs();
+ model->inputs();
+ }
+ } catch (...) {}
+
+ return 0;
+}