Skip to content

script: Fix IIRFilter crash on silent blocks and add crash test#56542

Merged
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_41091
Dec 6, 2025
Merged

script: Fix IIRFilter crash on silent blocks and add crash test#56542
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_41091

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

@servo-wpt-sync servo-wpt-sync commented Dec 5, 2025

Fix IIRFilter crash on silent blocks and add crash test.

Before fix: let blocks: SmallVec<[Block; 1]> = SmallVec::new(); followed by blocks.as_slice().iter().map(.), Because blocks was empty, the iterator never produced anything, so the resulting Chunk had zero blocks and caused:

panic: index out of bounds: the len is 0 but the index is 0 (thread AudioRenderThread, at /home/runner/.cargo/git/checkouts/media-9074def3f0bdf023/b0d3b74/audio/iir_filter_node.rs:173)

Now: we still use SmallVec<[Block; 1]>, but we actually push a block into it before returning: create Block::default(), call explicit_silence() on it, blocks.push(block), then Chunk { blocks }. This ensures the chunk contains one explicit silent block, which is what downstream code expects.

Actual fix is in:
servo/media#477

This PR uses the new media version containing fix and added crash test.

Testing: added crash test.
Fixes: servo/servo#41085

Reviewed in servo/servo#41091

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.

@servo-wpt-sync servo-wpt-sync force-pushed the servo_export_41091 branch 2 times, most recently from 51bf405 to 8914452 Compare December 6, 2025 19:12
@servo-wpt-sync servo-wpt-sync changed the title Fix IIRFilter crash on silent blocks and add crash test script: Fix IIRFilter crash on silent blocks and add crash test Dec 6, 2025
@servo-wpt-sync servo-wpt-sync merged commit d9042b7 into web-platform-tests:master Dec 6, 2025
25 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_41091 branch December 6, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants