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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user