Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect when Protobuf streams start with other file types' magic numbers #4449

Open
adamnovak opened this issue Nov 20, 2024 · 0 comments
Open

Comments

@adamnovak
Copy link
Member

If you try and turn a graph in any format other than vg Protobuf into JSON in the streaming mode, we just open the stream and try to read Graph objects. If this is actually not anything with VPKG framing but just a HashedGraph or PackedGraph or something, we don't look at the magic number and we fail to parse it as Protobuf and crash out.

get_input_file(file_name, [&](istream& in) {
vg::io::for_each(in, lambda);
});

We should assume the user will put square pegs into all round holes and notice and help them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant