Skip to content

script: Fix panic in compressedTexSubImage2D when no base image exists#59061

Open
servo-wpt-sync wants to merge 2 commits intoweb-platform-tests:masterfrom
servo:servo_export_44050
Open

script: Fix panic in compressedTexSubImage2D when no base image exists#59061
servo-wpt-sync wants to merge 2 commits intoweb-platform-tests:masterfrom
servo:servo_export_44050

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

@servo-wpt-sync servo-wpt-sync commented Apr 9, 2026

Calling compressedTexSubImage2D without a prior compressedTexImage2D for the same texture target and level caused the panic at tex_image_2d.rs:633 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. 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

Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants