We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21506c6 commit f3ad9ccCopy full SHA for f3ad9cc
onnxruntime/core/providers/openvino/backend_utils.cc
@@ -413,7 +413,11 @@ bool IsModelStreamXML(std::istream& model_stream) {
413
// Choose 32 bytes to hold content of:
414
// '<?xml version-"1.0"?> <net '
415
const std::streamsize header_check_len = 32;
416
- ORT_ENFORCE(total_size > header_check_len);
+ if (total_size < header_check_len) {
417
+ // Restore the stream position before returning
418
+ model_stream.seekg(originalPos);
419
+ return false;
420
+ }
421
422
// read 32 bytes into header
423
std::string header(header_check_len, '\0');
0 commit comments