From 0fafa6d87c6da30e9d7619f09b868e39eb72bbfa Mon Sep 17 00:00:00 2001 From: lt Date: Mon, 14 Oct 2024 10:53:40 +0800 Subject: [PATCH] fix: rtcp interceptor nil panic --- rtpreceiver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtpreceiver.go b/rtpreceiver.go index ba1afb5517c..7e7aebb473c 100644 --- a/rtpreceiver.go +++ b/rtpreceiver.go @@ -373,6 +373,9 @@ func (r *RTPReceiver) streamsForTrack(t *TrackRemote) *trackStreams { func (r *RTPReceiver) readRTP(b []byte, reader *TrackRemote) (n int, a interceptor.Attributes, err error) { <-r.received if t := r.streamsForTrack(reader); t != nil { + if t.rtcpInterceptor == nil { + return 0, nil, nil + } return t.rtpInterceptor.Read(b, a) }