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

Issue #20623: Check the input to WebGLRenderingContext's clear(). #20669

Merged
merged 1 commit into from May 20, 2018

Conversation

@simartin
Copy link
Contributor

simartin commented Apr 20, 2018

Validate the input to this function as per specifications.


  • ./mach build -d does not report any errors
  • ./mach build-geckolib does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #20623
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Apr 20, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs
  • @fitzgen: components/script/dom/webglrenderingcontext.rs
  • @KiChjang: components/script/dom/webglrenderingcontext.rs
// - DEPTH_BUFFER_BIT
// - STENCIL_BUFFER_BIT
// - COLOR_BUFFER_BIT
match mask & !(constants::DEPTH_BUFFER_BIT | constants::STENCIL_BUFFER_BIT | constants::COLOR_BUFFER_BIT) {

This comment has been minimized.

Copy link
@nox

nox Apr 21, 2018

Member

Just use if.

if mask & !(constants::DEPTH_BUFFER_BIT | constants::STENCIL_BUFFER_BIT | constants::COLOR_BUFFER_BIT) != 0 {
    return self.webgl_error(InvalidValue);
}

This comment has been minimized.

Copy link
@simartin

simartin Apr 21, 2018

Author Contributor

Yes indeed, thanks. PR amended accordingly.

// GL_INVALID_VALUE is generated if any bit other than the following is set in mask:
// - DEPTH_BUFFER_BIT
// - STENCIL_BUFFER_BIT
// - COLOR_BUFFER_BIT

This comment has been minimized.

Copy link
@nox

nox Apr 21, 2018

Member

Those comments just paraphrase the code. Please remove them.

@@ -39229,6 +39229,12 @@
{}
]
],
"mozilla/webgl/clear.html": [

This comment has been minimized.

Copy link
@nox

nox Apr 21, 2018

Member

@emilio We can't put tests there without causing issues for syncing with Khronos, right?

This comment has been minimized.

Copy link
@emilio

emilio May 15, 2018

Member

Yeah, think so.

This comment has been minimized.

Copy link
@jdm

jdm May 15, 2018

Member

No - we already have test files in that directory that are not part of the sync. It's fine to add additional ones.

@simartin simartin force-pushed the simartin:issue_20623 branch from 05e04e7 to f32ffeb Apr 21, 2018
@nox
Copy link
Member

nox commented Apr 21, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Apr 21, 2018

Trying commit f32ffeb with merge 71054c1...

bors-servo added a commit that referenced this pull request Apr 21, 2018
Issue #20623: Check the input to WebGLRenderingContext's clear().

Validate the input to this function as per specifications.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20623
- [X] There are tests for these changes

<!-- 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/20669)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 21, 2018

@simartin
Copy link
Contributor Author

simartin commented May 20, 2018

Is there anything outstanding for this PR to go in? Thanks.

@jdm
Copy link
Member

jdm commented May 20, 2018

@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2018

📌 Commit f32ffeb has been approved by jdm

@highfive highfive assigned jdm and unassigned mbrubeck May 20, 2018
@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2018

Testing commit f32ffeb with merge 0b57205...

bors-servo added a commit that referenced this pull request May 20, 2018
Issue #20623: Check the input to WebGLRenderingContext's clear().

Validate the input to this function as per specifications.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20623
- [X] There are tests for these changes

<!-- 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/20669)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 20, 2018

@bors-servo bors-servo merged commit f32ffeb into servo:master May 20, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@simartin simartin deleted the simartin:issue_20623 branch May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

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