mirror of https://bitbucket.org/ausocean/av.git
container/mts: checking index so that we don't go out of bounds
This commit is contained in:
parent
0497ee5302
commit
0d240fa7ff
|
@ -324,6 +324,9 @@ func GetPTSRange(clip []byte, pid uint16) (pts [2]uint64, err error) {
|
|||
// Find the first packet with PID pidType and PUSI.
|
||||
var i int
|
||||
for {
|
||||
if i >= len(clip) {
|
||||
return [2]uint64{}, errors.New("could not find payload start")
|
||||
}
|
||||
pkt, _i, err := FindPid(clip[i:], pid)
|
||||
if err != nil {
|
||||
return [2]uint64{}, err
|
||||
|
|
Loading…
Reference in New Issue