From f4d9ad60aca3878cf4fb3eff171e83e4097516ee Mon Sep 17 00:00:00 2001 From: nareix Date: Sat, 11 Jun 2016 09:27:19 +0800 Subject: [PATCH] check stream index when parse block --- client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.go b/client.go index 03dbaa9..463171d 100644 --- a/client.go +++ b/client.go @@ -562,6 +562,10 @@ func (self *Client) parseBlock(blockNo int, packet []byte) (streamIndex int, err } streamIndex = blockNo/2 + if streamIndex >= len(self.streams) { + err = fmt.Errorf("rtsp: parseBlock: streamIndex=%d invalid", streamIndex) + return + } stream := self.streams[streamIndex] /*