Skip to content

Commit

Permalink
Fix offsets mismatch for HETERO plugin blob headers
Browse files Browse the repository at this point in the history
  • Loading branch information
MirceaDan99 committed Jan 14, 2025
1 parent 6be7805 commit d92d789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/intel_npu/src/plugin/src/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ std::streampos getFileSize(std::istream& stream) {
}

if (dynamic_cast<ov::OwningSharedStreamBuffer*>(stream.rdbuf()) != nullptr) {
return stream.rdbuf()->in_avail() + stream.tellg();
return stream.rdbuf()->in_avail();
}

const std::streampos streamStart = stream.tellg();
Expand Down Expand Up @@ -123,7 +123,7 @@ std::unique_ptr<MetadataBase> read_metadata_from(std::istream& stream) {
blobMagicBytes.resize(magicBytesSize);

std::streampos currentStreamPos = stream.tellg(), streamSize = getFileSize(stream);
stream.seekg(-currentStreamPos + streamSize - magicBytesSize, std::ios::cur);
stream.seekg(streamSize - std::streampos(magicBytesSize), std::ios::cur);
stream.read(blobMagicBytes.data(), magicBytesSize);
if (MAGIC_BYTES != blobMagicBytes) {
OPENVINO_THROW("Blob is missing NPU metadata!");
Expand Down

0 comments on commit d92d789

Please sign in to comment.