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

Parameter methods are probably unsound #10

Open
nox opened this issue Oct 17, 2019 · 3 comments
Open

Parameter methods are probably unsound #10

nox opened this issue Oct 17, 2019 · 3 comments

Comments

@nox
Copy link

nox commented Oct 17, 2019

Method Gl::get_tex_parameter_iv when passed GL_TEXTURE_BORDER_COLOR will try to write four integer values in a &mut GLint which is obviously not large enough.

The same thing can happen with Gl::get_tex_parameter_fv.

For now, it can't happen with Gl::get_framebuffer_attachment_parameter_iv and Gl::get_renderbuffer_parameter_iv because all framebuffer attachment and renderbuffer parameters are single-valued, but nothing guarantees us that this will be true of all GL extensions in the future, so I would make it unsafe too.

Cc @kvark with whom I had debated about that in the past when it was a problem in gleam.

@nox
Copy link
Author

nox commented Oct 17, 2019

Other methods that may need to be unsafe include Gl::get_query_iv, Gl::get_query_object_iv, Gl::get_query_object_uiv, Gl::get_query_object_i64v and Gl::get_query_object_ui64v.

@nox
Copy link
Author

nox commented Oct 17, 2019

This is also an issue for the following sample parameter methods:

  • Gl::get_sampler_parameter_iv
  • Gl::get_sampler_parameter_fv
  • Gl::sampler_parameter_iv
  • Gl::sampler_parameter_fv

@nox
Copy link
Author

nox commented Oct 17, 2019

There are at least three extensions that can help here, ANGLE_robust_client_memory, EXT_robustness and ARB_robustness.

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