Bug 302521

Summary: REGRESSION (Safari 26): AudioData.copyTo() crashes the tab with valid conversion
Product: WebKit Reporter: hi
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jean-yves.avenard, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 26   
Attachments:
Description Flags
test case none

hi
Reported 2025-11-14 01:12:38 PST
The following snippet crashes the tab, as of Safari Technology Preview 231, seems like code has not changed since. ``` const data = new AudioData({ numberOfChannels: 3, data: new Float32Array([1, 1, 1]), format: 'f32', numberOfFrames: 1, sampleRate: 48000, timestamp: 0, }); const dataBytes = new Float32Array(1); data.copyTo(dataBytes, {planeIndex: 2, format: 'f32-planar'}); console.log(dataBytes); ``` It's a `pac violation` according to Console.app. What is happening here? We have interleaved audio with 3 channels. We would like to turn this into planar audio (spec says: "Conversion to f32-planar MUST always be supported"). The correct behavior would be to take every third element of the input array and copy that into the destination buffer. Chrome correctly performs the conversion and returns `Float32Array([1])`.
Attachments
test case (307 bytes, text/html)
2025-11-14 09:35 PST, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2025-11-14 09:34:53 PST
This hits: RELEASE_ASSERT(sourcePlane.size() >= sampleIndexIncrement * samples + sampleOffset - 1);
Radar WebKit Bug Importer
Comment 2 2025-11-14 09:34:58 PST
Alexey Proskuryakov
Comment 3 2025-11-14 09:35:18 PST
Created attachment 477397 [details] test case Same test as an attachment.
Nipun Shukla
Comment 4 2025-12-08 23:13:45 PST
EWS
Comment 5 2025-12-18 22:06:21 PST
Committed 304728@main (3fe28c6ca996): <https://commits.webkit.org/304728@main> Reviewed commits have been landed. Closing PR #55085 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.