diff --git a/pkg/tcp/textproto.go b/pkg/tcp/textproto.go index 5afe7628..c6290150 100644 --- a/pkg/tcp/textproto.go +++ b/pkg/tcp/textproto.go @@ -2,6 +2,7 @@ package tcp import ( "bufio" + "errors" "fmt" "io" "net/textproto" @@ -46,6 +47,9 @@ func ReadResponse(r *bufio.Reader) (*Response, error) { if err != nil { return nil, err } + if line == "" { + return nil, errors.New("empty response on RTSP request") + } ss := strings.SplitN(line, " ", 3) if len(ss) != 3 {