From c0b755f82fefeba776ac80ee1a2fe4883a83771d Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 14 Apr 2024 15:11:30 +0200 Subject: [PATCH] Fix overflow in AV1 parser. --- codecs/codecs.go | 3 +++ 1 file changed, 3 insertions(+) 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++