diff --git a/codecs/codecs.go b/codecs/codecs.go index ea5ab4c..91690a5 100644 --- a/codecs/codecs.go +++ b/codecs/codecs.go @@ -65,6 +65,9 @@ func Keyframe(codec string, packet *rtp.Packet) (bool, bool) { if len(data) <= offset { return nil, offset, offset > 0 } + if offset >= 4 { + return nil, offset, true + } l := data[offset] length |= int(l&0x7f) << (offset * 7) offset++