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

Reading file causes heap corruption #47

Open
HiImJulien opened this issue Oct 22, 2020 · 1 comment
Open

Reading file causes heap corruption #47

HiImJulien opened this issue Oct 22, 2020 · 1 comment

Comments

@HiImJulien
Copy link

HiImJulien commented Oct 22, 2020

Hey there!
Lately I am fighting with heap corruptions, that are caused by the custom deleter used by the class Buffer.
This bug probably related to #3 and #46.

The file I tried to parse, uses tri- and quadfaces; while latter were unwanted it causes your parser to exhibit following behavior:

Reading the lists with a size hint

const auto index_buffer = ply.request_properties_from_element("face", {"vertex_indices"}, 3);

causes a Heap corruption, when cleaning up the buffer.

Omitting the list_size_hint yields the exception, that "Variable length lists are not supported." as probably expected.

@ddiakopoulos
Copy link
Owner

#3 is accurate. #46 I resolved with the issue's author on email somewhat (NaN's in ascii are not supported but I don't document that anywhere). I'm not sure I'll address this particular issue as a hotfix to version 2.3. Version 2.4 is on a branch and supports variable length lists correctly.

The specific bug you're running into with the heap corruption is that I never verify that the list size matches the hint in the inner loop and then throw a similar exception. I might have had it at one point and removed for better performance.

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

2 participants