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

Fixes PLY reader when the header ends with \r\n #4936

Merged
merged 2 commits into from Feb 4, 2023

Conversation

TinyTinni
Copy link
Contributor

When "getNextBlock" was called after "getNextLine", the pointer could still on the newline.

The pointer to a newline could not advance enough, when the line ended with \r\n. The resulting buffer was correct, as the buffer range went from until \r, but that the pointer increased by just 1 could lead to the problem that the next pointer points at \n, which is still part of the newline and therefore, "getNextBlock" got 1 byte too much.

Refs Issue #4871

I added a test with a copy of the PLY file inside the test directory. I couldn't figure out a good name. I hope this is ok. A name idea would be appreciated.

The comment removed is an outdated comment from me.

TinyTinni and others added 2 commits February 4, 2023 15:16
… still on the newline.

The pointer to a newline could not advance enough, when the line ended with \r\n. The resulting buffer was correct, as the buffer range went from <start> until \r, but that the pointer increased by just 1 could lead to the problem that the next pointer points at \n, which is still part of the newline and therefore, "getNextBlock" got 1 byte too much.

Refs Issue assimp#4871
Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

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

Looks fine.

@kimkulling kimkulling merged commit e6877cf into assimp:master Feb 4, 2023
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

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

Successfully merging this pull request may close these issues.

None yet

2 participants