Skip to content

Commit 7b04437

Browse files
committed
ice fix
1 parent b46abd1 commit 7b04437

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

media/ice/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,11 +913,14 @@ impl IceAgent {
913913
}
914914
};
915915

916-
let pair = self
916+
let Some(pair) = self
917917
.pairs
918918
.iter_mut()
919919
.find(|p| p.local == local_id && p.remote == remote_id)
920-
.expect("local_id & remote_id are valid");
920+
else {
921+
log::warn!("Got STUN request for candidates without pair {local_id:?} {remote_id:?}");
922+
return;
923+
};
921924

922925
pair.received_use_candidate = use_candidate;
923926
log::trace!(

media/rtc/src/sdp/media.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ impl Media {
138138
self.codec_pt.local
139139
}
140140

141-
142-
143141
/// Returns if the payload type is actual media, excludes rtx streams
144142
pub(super) fn is_remote_media_pt(&self, pt: u8) -> bool {
145143
self.codec_pt.remote == pt || self.dtmf_pt.is_some_and(|x| x.remote == pt)

0 commit comments

Comments
 (0)