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
@@ -154,7 +154,7 @@ func (b *Buffer) Write(pkt []byte) (n int, err error) {
now := mono.UnixNano()
if b.twcc != nil && b.twccExtID != 0 {
if ext := rtpPacket.GetExtension(b.twccExtID); ext != nil {
if ext := rtpPacket.GetExtension(b.twccExtID); len(ext) >= 2 {
b.twcc.Push(rtpPacket.SSRC, binary.BigEndian.Uint16(ext[0:2]), now, rtpPacket.Marker)
}
}