rtmp: check that len(buf) is not less than 4 before buf = buf[4:]

This commit is contained in:
saxon 2018-09-02 13:31:52 +09:30
parent 6da0967b80
commit 3d3ec6b893
1 changed files with 3 additions and 0 deletions

View File

@ -2188,6 +2188,9 @@ func C_RTMP_Write(r *C_RTMP, buf []byte) int {
if ret == 0 {
return -1
}
if len(buf) < 4 {
break
}
buf = buf[4:]
}
}