Check slice length before access in a couple of more places (#4752)

* Check slice length before access in a couple of more places

* min 🤦

* lint
This commit is contained in:
Raja Subramanian
2026-08-13 18:20:37 +05:30
committed by GitHub
parent 7d556cfefe
commit cc6551d617
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ func (r *RedPrimaryReceiver) ForwardRTP(pkt *buffer.ExtPacket, spatialLayer int3
"packetExtractedTS", pkts[i].Timestamp,
"packetETS", pPkt.ExtTimestamp,
"pktHistory", r.pktHistory,
"redHeader", pkt.Packet.Payload[:10],
"redHeader", pkt.Packet.Payload[:min(len(pkt.Packet.Payload), 10)],
"payloadSize", len(pkt.Packet.Payload),
"lastSeq", r.lastSeq,
"highestFowardedExtSequenceNumber", r.highestForwardedExtSequenceNumber,