Skip to content

fix(ios): audio player use after free - #1334

Merged
mdydek merged 3 commits into
mainfrom
fix/ios-audio-player-auf
Oct 8, 2026
Merged

mdydek merged 3 commits into
mainfrom
fix/ios-audio-player-auf

Conversation

@closetcaiman

@closetcaiman closetcaiman commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Closes #

⚠️ Breaking changes ⚠️

  • N/A

Introduced changes

  • removed inherited constructor (AudioPlayer::AudioPlayer) from IOSAudioPlayer.h as when compiling AudioContext it was included and thus a constructor was generated by the compiler (from .cpp) which initialized NativeAudioPlayer *audioPlayer_ with a raw pointer without ARC (automatic reference counting) included (as it would have been if it was compilied from .mm.)

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

@closetcaiman closetcaiman added fix Code changes specifically addressing and resolving a bug ios Native iOS implementation, CoreAudio/AVFoundation bindings, or iOS-specific issues labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

WPT non-regression comparison

PASS — no regressions · 0 improved section(s) · overall 3427 → 3427 (0)

Unchanged sections (28)
Spec section Base pass Head pass Delta
Processing model 1 1 0
Other 56 56 0
AnalyserNode 138 138 0
AudioBuffer 140 140 0
AudioBufferSourceNode 220 220 0
AudioContext 58 58 0
AudioNode 261 261 0
AudioParam 680 680 0
BiquadFilterNode 275 275 0
ChannelMergerNode 30 30 0
ChannelSplitterNode 7 7 0
ConstantSourceNode 64 64 0
ConvolverNode 178 178 0
DelayNode 127 127 0
DestinationNode 0 0 0
DynamicsCompressorNode 4 4 0
GainNode 15 15 0
IIRFilterNode 87 87 0
MediaElementAudioSourceNode 0 0 0
MediaStreamAudioDestinationNode 1 1 0
MediaStreamAudioSourceNode 0 0 0
OfflineAudioContext 35 35 0
OscillatorNode 104 104 0
PannerNode 727 727 0
PeriodicWave 33 33 0
ScriptProcessorNode 0 0 0
StereoPannerNode 104 104 0
WaveShaperNode 82 82 0

Baseline: 8588c315e7d87d76780e4189f6cc5d4acd0ea582 · Candidate: bc78d8fbf405c506812b70fc81ec32db4d0ea3c0

Workflow run · this comment is updated on every push.

@github-actions github-actions Bot added the conflicts This PR has conflicts with the base branch. label Oct 7, 2026
@github-actions github-actions Bot removed the conflicts This PR has conflicts with the base branch. label Oct 7, 2026

@SomePersonFromMars SomePersonFromMars left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's quite of an interesting fix. It is worth changing the PR description, because it is slightly misleading due to a change in the method used to perform the fix. It is worth emphasising that this PR:

  • Removed conditional compilation depending on __OBJC__, which caused some translation units to believe that audioPlayer_ was a pointer to an ordinary C struct, while others knew that it was actually a __strong pointer to an Objective C object supporting ARC (automatic reference counting). As a result, all translation units now can properly emit calls to the reference counting functions.

@mdydek
mdydek merged commit 93404ee into main Oct 8, 2026
14 checks passed
@mdydek
mdydek deleted the fix/ios-audio-player-auf branch October 8, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Code changes specifically addressing and resolving a bug ios Native iOS implementation, CoreAudio/AVFoundation bindings, or iOS-specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants