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

Fix EGL device pointer #1695

Closed
wants to merge 1 commit into from

Conversation

chrisduerr
Copy link
Contributor

This fixes an issue where eglQueryDisplayAttribEXT would always fail since the pointer passod to it didn't match its expectations.

This fixes an issue where `eglQueryDisplayAttribEXT` would always fail
since the pointer passod to it didn't match its expectations.
@@ -211,7 +211,8 @@ impl Display {
}));
}

Device::from_ptr(self.inner.egl, device)
let device_ptr = unsafe { ptr::null_mut::<c_void>().offset(device_offset) };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's probably a better way to do this? But that's the first thing I could come up with as someone who doesn't do Rust pointers much.

@MarijnS95
Copy link
Member

Thanks for reporting this @chrisduerr! That's indeed a bug, but this (using offset() and all) isn't the right way to deal with passing a "pointer to a to-be-initialized pointer". The meat of your change is in passing &mut to QueryDisplayAttribEXT(). I've opened #1696 to demonstrate how to do this, while also rewriting the commit description to explain the situation. Do you want a Reported-by: tag?

@kchibisov
Copy link
Member

See #1696

@kchibisov kchibisov closed this Sep 5, 2024
@chrisduerr chrisduerr deleted the egl_device branch September 5, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants