mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-12 18:00:12 +00:00
webrtc: fix crash when marshaling ICE fragments (#3231)
This commit is contained in:
parent
5a39e07eb7
commit
4354535a94
@ -60,6 +60,9 @@ func ICEFragmentMarshal(offer string, candidates []*webrtc.ICECandidateInit) ([]
|
||||
|
||||
candidatesByMedia := make(map[uint16][]*webrtc.ICECandidateInit)
|
||||
for _, candidate := range candidates {
|
||||
if candidate.SDPMLineIndex == nil {
|
||||
return nil, fmt.Errorf("sdpMLineIndex is null")
|
||||
}
|
||||
mid := *candidate.SDPMLineIndex
|
||||
candidatesByMedia[mid] = append(candidatesByMedia[mid], candidate)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user