mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 00:44:12 +00:00
Fix panic with invalid layer. (#3470)
* Fix panic with invalid layer. Log an error so that we can understand which track porduces that. * drop bad layer packet without forwarding
This commit is contained in:
@@ -770,6 +770,14 @@ func (w *WebRTCReceiver) forwardRTP(layer int32, buff *buffer.Buffer) {
|
||||
// svc packet, take spatial layer info from packet
|
||||
spatialLayer = pkt.Spatial
|
||||
}
|
||||
if int(spatialLayer) >= len(spatialTrackers) {
|
||||
w.logger.Errorw(
|
||||
"unexpected spatial layer", nil,
|
||||
"spatialLayer", spatialLayer,
|
||||
"pktSpatialLayer", pkt.Spatial,
|
||||
)
|
||||
continue
|
||||
}
|
||||
|
||||
writeCount := w.downTrackSpreader.Broadcast(func(dt TrackSender) {
|
||||
_ = dt.WriteRTP(pkt, spatialLayer)
|
||||
|
||||
Reference in New Issue
Block a user