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

webgl: Uninitialized data leak from ReadPixels() #13901

Closed
anholt opened this issue Oct 24, 2016 · 0 comments
Closed

webgl: Uninitialized data leak from ReadPixels() #13901

anholt opened this issue Oct 24, 2016 · 0 comments

Comments

@anholt
Copy link
Contributor

@anholt anholt commented Oct 24, 2016

From the GLES 2.0.25 spec on glReadPixels():

If any of these pixels lies outside of the window allocated to the current GL context, the values obtained for those pixels are undefined.

but from the WebGL spec:

For any pixel lying outside the frame buffer, the corresponding destination buffer range remains untouched; see Reading Pixels Outside the Framebuffer.

This is triggered by the object-deletion-behaviour.html test once checkFramebufferStatus() starts returning GL_FRAMEBUFFER_COMPLETE.

@jdm jdm added the A-content/webgl label Oct 24, 2016
anholt added a commit to anholt/servo that referenced this issue Nov 5, 2016
This fixes the crash in read-pixels-pack-alignment (which was trying
to read out of bounds).

Fixes servo#13901
@anholt anholt mentioned this issue Nov 5, 2016
4 of 5 tasks complete
bors-servo added a commit that referenced this issue Nov 5, 2016
webgl: out-of-bounds readPixels() fixes

<!-- Please describe your changes on the following line: -->
Fix crashes in two WebGL readPixels() tests by adding framebuffer size validation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13901

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14081)
<!-- Reviewable:end -->
anholt added a commit to anholt/servo that referenced this issue Nov 5, 2016
This fixes the crash in read-pixels-pack-alignment (which was trying
to read out of bounds).

Fixes servo#13901
bors-servo added a commit that referenced this issue Nov 9, 2016
webgl: out-of-bounds readPixels() fixes

<!-- Please describe your changes on the following line: -->
Fix crashes in two WebGL readPixels() tests by adding framebuffer size validation.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13901

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14081)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.