servo / sparkle

GL bindings for Servo's WebGL implementation (alternative to the `gleam` crate)
7 stars 5 forks source link

Generic buffer data methods are unsound #11

Open nox opened 5 years ago

nox commented 5 years ago

Methods Gl::buffer_data and Gl::sub_buffer_data pass slices of arbitrary T values to the GL system, but those Ts may have padding, which is uninitialised, which means we are passing uninitialised data to the GL system that may be read back by Rust later. The T type parameter should be constrained by some sort of unsafe trait to prevent that.