servo / sparkle

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

Some texture methods are unsound #9

Open nox opened 5 years ago

nox commented 5 years ago

Those methods take a buffer, pass it to a GL API as a pointer, and let GL decide how many bytes it should read from it through a combination of other inputs (for example, width and height), these methods should be unsafe:

Furthermore, the GL functions for compressed textures also specify that undefined results can occur "if data is not encoded in a manner consistent with the extension specification defining the internal compression format", so the two methods using them should probably marked as unsafe too:

asajeffrey commented 5 years ago

I think we can add read_pixels to that list, since it returns unintialized values if you ask it to read outside the framebuffer.