diff --git a/internal/protocols/rtmp/amf0/unmarshal.go b/internal/protocols/rtmp/amf0/unmarshal.go index 26eb0558..a5b1c81e 100644 --- a/internal/protocols/rtmp/amf0/unmarshal.go +++ b/internal/protocols/rtmp/amf0/unmarshal.go @@ -200,6 +200,18 @@ func unmarshal(buf []byte) (interface{}, []byte, error) { } return nil, buf, nil + case markerLongString: + if len(buf) < 4 { + return nil, nil, errBufferTooShort + } + keyLen := uint32(buf[0])<<24 | uint32(buf[1])<<16 | uint32(buf[2])<<8 | uint32(buf[3]) + buf = buf[4:] + if len(buf) < int(keyLen) { + return nil, nil, errBufferTooShort + } + + return string(buf[:keyLen]), buf[keyLen:], nil + default: return nil, nil, fmt.Errorf("unsupported marker 0x%.2x", marker) }