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
|
// svc packet, take spatial layer info from packet
|
||||||
spatialLayer = pkt.Spatial
|
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) {
|
writeCount := w.downTrackSpreader.Broadcast(func(dt TrackSender) {
|
||||||
_ = dt.WriteRTP(pkt, spatialLayer)
|
_ = dt.WriteRTP(pkt, spatialLayer)
|
||||||
|
|||||||
Reference in New Issue
Block a user