Fix nil pointer dereference (#1949)

This commit is contained in:
Raja Subramanian
2023-08-10 01:31:51 +05:30
committed by GitHub
parent 0e9ec9a21e
commit f22d1e5a75
+2
View File
@@ -770,8 +770,10 @@ func (r *RTPStats) MaybeAdjustFirstPacketTime(srData *RTCPSenderReportData) {
r.lock.Lock() r.lock.Lock()
defer r.lock.Unlock() defer r.lock.Unlock()
if srData != nil {
r.maybeAdjustFirstPacketTime(srData.RTPTimestampExt) r.maybeAdjustFirstPacketTime(srData.RTPTimestampExt)
} }
}
func (r *RTPStats) maybeAdjustFirstPacketTime(extTS uint64) { func (r *RTPStats) maybeAdjustFirstPacketTime(extTS uint64) {
if time.Since(r.startTime) > firstPacketTimeAdjustWindow { if time.Since(r.startTime) > firstPacketTimeAdjustWindow {