Skip to content

webgl: check TexImage3D's input data length#44270

Merged
mrobinson merged 1 commit intoservo:mainfrom
simartin:issue_42881
Apr 16, 2026
Merged

webgl: check TexImage3D's input data length#44270
mrobinson merged 1 commit intoservo:mainfrom
simartin:issue_42881

Conversation

@simartin
Copy link
Copy Markdown
Contributor

tex-3d-size-limit.html currently crashes because we don't check that the input data is large enough, and happily access memory that's not ours if it's not.

The referenced ticket comes from the fact that we don't systematically detect a crash (which makes sense if we're (un)lucky), and this patch eradicates the crash altogether by checking the input buffer size. The size computation is a (partial) port of WPT's computeImageSizes3D JS function.

Fixes: #42881
Testing: Some expected failures in wpt/webgl can be removed, including a crash.

@simartin simartin requested a review from gterzian as a code owner April 16, 2026 10:59
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 16, 2026
@simartin
Copy link
Copy Markdown
Contributor Author

Manual try linux-wpt => https://github.com/simartin/servo/actions/runs/24503740475

tex-3d-size-limit.html currently crashes because we don't check that the
input data is large enough, and happily access memory that's not ours if
it's not.

The referenced ticket comes from the fact that we don't systematically
detect a crash (which makes sense if we're (un)lucky), and this patch
eradicates the crash altogether by checking the input buffer size. The
size computation is a (partial) port of WPT's computeImageSizes3D JS
function.

Fixes: servo#42881
Testing: Some expected failures in wpt/webgl can be removed, including a
crash.
Signed-off-by: Simon Martin <simon@nasilyan.com>
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 16, 2026
@mrobinson mrobinson added this pull request to the merge queue Apr 16, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 16, 2026
Merged via the queue into servo:main with commit 5634eab Apr 16, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 16, 2026
@simartin simartin deleted the issue_42881 branch April 16, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent error in /_webgl/conformance2/textures/misc/tex-3d-size-limit.html

3 participants