Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RtpReceiver use after free on Android #165

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ All user visible changes to this project will be documented in this file. This p
- Unexpected audio category on `setOutputAudioId` call on [iOS]. ([#146])
- Race condition bug on `setOutputAudioId` call on [Android]. ([#146])
- Race condition bug on input/output device switch on desktop platforms. ([#151])
- `RtpReceiver` use after free on [Android]. ([#165])

[#137]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/137
[#139]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/139
Expand All @@ -47,6 +48,7 @@ All user visible changes to this project will be documented in this file. This p
[#156]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/156
[#162]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/162
[#164]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/164
[#165]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/165
[`dart:html`]: https://dart.dev/libraries/dart-html
[`package:web`]: https://pub.dev/packages/web
[126.0.6478.182-r2]: https://github.com/instrumentisto/libwebrtc-bin/releases/tag/126.0.6478.182-r2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class PeerObserver : PeerConnection.Observer {
override fun onTrack(transceiver: RtpTransceiver?) {
if (transceiver != null && peer != null) {
if (!peer!!.disposed) {
val receiverId = transceiver.receiver.id()
Handler(Looper.getMainLooper()).post {
val receiver = transceiver.receiver
val transceivers = peer?.getTransceivers()!!
for (trans in transceivers) {
if (trans.receiver.id == receiver.id()) {
if (trans.receiver.id == receiverId) {
peer?.observableEventBroadcaster()?.onTrack(trans.receiver.track, trans)
}
}
Expand Down
Loading