Bug 233174 - Safari 15.1 regression: RTCRtpSender.replaceTrack with a disabled track crashes safari
Summary: Safari 15.1 regression: RTCRtpSender.replaceTrack with a disabled track crash...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-15 22:57 PST by Arjun Vade
Modified: 2021-11-16 07:02 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arjun Vade 2021-11-15 22:57:36 PST
Steps to reproduce:
1.Visit https://webrtc.github.io/samples/src/content/peerconnection/pc1/
2. Click on Start and Call buttons. Note that this app/demo exposes `pc1` on console which is a RTCPeerConnection object
3. Invoke the following code from the dev tools console:


black = ({ width = 640, height = 480 } = {}) => {
  const canvas = Object.assign(document.createElement('canvas'), { width, height });
  canvas.getContext('2d').fillRect(0, 0, width, height);
  const stream = canvas.captureStream();
  return Object.assign(stream.getVideoTracks()[0], { enabled: false }); // Note: changing enabled to true doesn't crash safari
};

dummyTrack = black();

pc1.getSenders()[0].replaceTrack(dummyTrack)

4. Notice that safari crashes.

Happens only on Safari 15.1, earlier versions were fine, so this is a regression. Happens both on BigSur and Monterey
Comment 1 youenn fablet 2021-11-16 07:02:54 PST
Thanks for the report Arjun.
This should be fixed in latest iOS 15.2 beta.