Skip to content

Commit

Permalink
Merge pull request #30 from fanap-infra/fix/memory-check
Browse files Browse the repository at this point in the history
do not change state
  • Loading branch information
saeid-a authored Jan 23, 2021
2 parents 623bc51 + 67e7867 commit a196307
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,17 @@ func (self *Client) findRTSP() (block []byte, data []byte, err error) {

// logRTP.Tracev("rtsp: findRTSP", "i", i, "b", b)

if len(peek) > 20000000 {
log.Errorv("PeekLength", "len(peek)", len(peek), "len(block)", len(block))
peek = peek[(len(peek) / 2):]
stat = 0
if len(peek) > 40000000 {
log.Errorv("PeekLength", "len(peek)", len(peek), "len(block)", len(block), "stat", stat)
err = fmt.Errorf("rtsp: Parse error")
return
// peek = peek[(len(peek) / 2):]
// stat = 0
}
if len(block) > 20000000 {
log.Errorv("BlockLength", "len(peek)", len(peek), "len(block)", len(block))
block = block[(len(block) / 2):]
stat = 0
if len(block) > 40000000 {
log.Errorv("BlockLength", "len(peek)", len(peek), "len(block)", len(block), "stat", stat)
// block = block[(len(block) / 2):]
// stat = 0
}

if stat != 0 {
Expand Down

0 comments on commit a196307

Please sign in to comment.