Skip to content

Use after free in HeifContext::read_from_bytes? #13

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

Closed
sophie-h opened this issue Jun 5, 2023 · 2 comments
Closed

Use after free in HeifContext::read_from_bytes? #13

sophie-h opened this issue Jun 5, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

Image for: Comments
Copy link

sophie-h commented Jun 5, 2023

I had issues with HeifContext::read_from_bytes and dropping the argument before decoding the image afterward. I think it crashed with segfaulted, but I don't know for sure. It does not happen with every image.

I guess read_from_bytes might need to take ownership of the bytes or a lifetime guarantee.

Maybe the issue is obvious when looking at libheif API. If it's not, I can try to create a reproducer soon. (Currently a bit busy with moving.)

Cykooz self-assigned this Jun 5, 2023
Copy link
Owner

Cykooz commented Jun 5, 2023

Oh, you are right. I will try to fix it.

Cykooz added the bug Something isn't working label Jun 5, 2023
Cykooz added a commit that referenced this issue Jun 5, 2023
…ee" in case it is created from ``&[u8]`` ([#13]).
Copy link
Owner

Cykooz commented Jun 5, 2023

I've released version 0.20 with added lifetime for HeifContext.

Cykooz closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants