mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-19 05:21:09 +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)
|
candidatesByMedia := make(map[uint16][]*webrtc.ICECandidateInit)
|
||||||
for _, candidate := range candidates {
|
for _, candidate := range candidates {
|
||||||
|
if candidate.SDPMLineIndex == nil {
|
||||||
|
return nil, fmt.Errorf("sdpMLineIndex is null")
|
||||||
|
}
|
||||||
mid := *candidate.SDPMLineIndex
|
mid := *candidate.SDPMLineIndex
|
||||||
candidatesByMedia[mid] = append(candidatesByMedia[mid], candidate)
|
candidatesByMedia[mid] = append(candidatesByMedia[mid], candidate)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user