script: Fix panic in compressedTexSubImage2D when no base image exists#59061
Open
servo-wpt-sync wants to merge 2 commits intoweb-platform-tests:masterfrom
Open
script: Fix panic in compressedTexSubImage2D when no base image exists#59061servo-wpt-sync wants to merge 2 commits intoweb-platform-tests:masterfrom
servo-wpt-sync wants to merge 2 commits intoweb-platform-tests:masterfrom
Conversation
wpt-pr-bot
approved these changes
Apr 9, 2026
Collaborator
wpt-pr-bot
left a comment
There was a problem hiding this comment.
The review process for this patch is being conducted in the Servo project.
8f5ae48 to
4a4fbbd
Compare
Calling compressedTexSubImage2D without a prior compressedTexImage2D for the same texture target and level caused a panic because image_info_for_target returned None and .unwrap() was called on it. Per the WebGL spec, this should generate GL_INVALID_OPERATION instead of panicking. Replace the unwrap with proper error handling. Also adds a WPT crash test that reproduces the original panic. Fixes: web-platform-tests#43527 Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
…rness Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
4a4fbbd to
3d10397
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling
compressedTexSubImage2Dwithout a priorcompressedTexImage2Dfor the same texture target and level caused the panic attex_image_2d.rs:633becauseimage_info_for_targetreturnedNoneand.unwrap()was called on it.Per the WebGL spec, this should generate
GL_INVALID_OPERATIONinstead of panicking. So this PR replaces the unwrap with proper error handling. And also includes a WPT crash test that reproduces the original panic.Fixes #43527
Reviewed in servo/servo#44050