Skip to content

[CORE] The vector returned by ov::util::load_binary() has a size of 0.#33882

Open
sungeunk wants to merge 1 commit intoopenvinotoolkit:masterfrom
sungeunk:issue_load_binary
Open

[CORE] The vector returned by ov::util::load_binary() has a size of 0.#33882
sungeunk wants to merge 1 commit intoopenvinotoolkit:masterfrom
sungeunk:issue_load_binary

Conversation

@sungeunk
Copy link
Contributor

@sungeunk sungeunk commented Jan 30, 2026

The vector returned by ov::util::load_binary() has a size of 0.

This issue occurs after PR#33396

@sungeunk sungeunk requested a review from a team as a code owner January 30, 2026 01:08
@github-actions github-actions bot added the category: Core OpenVINO Core (aka ngraph) label Jan 30, 2026
buffer.reserve(std::filesystem::file_size(path));
input.read(reinterpret_cast<char*>(buffer.data()), buffer.capacity());
buffer.resize(std::filesystem::file_size(path));
input.read(reinterpret_cast<char*>(buffer.data()), buffer.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be test be added to reproduce the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@praasz As you know, 'reserve() does not change the size of the vector.'
Refer link: https://en.cppreference.com/w/cpp/container/vector/reserve

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it could be fix using back inserter and still use reserve
But test could be added to catch the issue

@praasz praasz added this to the 2026.1 milestone Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Core OpenVINO Core (aka ngraph)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants