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

Do not try to read pixels from an FBO without read buffer #25975

Merged
merged 1 commit into from Mar 17, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Do not try to read pixels from an FBO without read buffer

Adds another check to the WebGL2 ReadPixels implementation to fix
an OpenGL invalid operation crash when the method is called on a
bound framebuffer that has no read buffer.
  • Loading branch information
mmatyas committed Mar 17, 2020
commit a6359fe587aa5ed55aee8bb1b7a4a2c4138ec6c3
@@ -349,7 +349,11 @@ impl WebGL2RenderingContext {
}

let fb_slot = self.base.get_draw_framebuffer_slot();
if fb_slot.get().is_none() && self.default_fb_readbuffer.get() == constants::NONE {
let fb_readbuffer_valid = match fb_slot.get() {
Some(fb) => fb.attachment(fb.read_buffer()).is_some(),
None => self.default_fb_readbuffer.get() != constants::NONE,
};
if !fb_readbuffer_valid {
return self.base.webgl_error(InvalidOperation);
}

@@ -1,8 +1,2 @@
[readbuffer.html]
expected: TIMEOUT
[WebGL test #3: gl.getParameter(gl.READ_BUFFER) should be 1029 (of type number). Was null (of type object).]
expected: FAIL

[WebGL test #4: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
expected: FAIL

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.