mirror of
https://github.com/aler9/gortsplib
synced 2025-10-17 12:40:45 +08:00
improve coverage (#168)
This commit is contained in:
@@ -56,3 +56,26 @@ func TestDTSExtractor(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func FuzzDTSExtractor(f *testing.F) {
|
||||
sps := []byte{
|
||||
0x42, 0x01, 0x01, 0x01, 0x60, 0x00, 0x00, 0x03,
|
||||
0x00, 0x90, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03,
|
||||
0x00, 0x78, 0xa0, 0x03, 0xc0, 0x80, 0x10, 0xe5,
|
||||
0x96, 0x66, 0x69, 0x24, 0xca, 0xe0, 0x10, 0x00,
|
||||
0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x03, 0x01,
|
||||
0xe0, 0x80,
|
||||
}
|
||||
|
||||
pps := []byte{
|
||||
0x44, 0x01, 0xc1, 0x72, 0xb4, 0x62, 0x40,
|
||||
}
|
||||
|
||||
ex := NewDTSExtractor()
|
||||
f.Fuzz(func(t *testing.T, b []byte, p uint64) {
|
||||
if len(b) < 1 {
|
||||
return
|
||||
}
|
||||
ex.Extract([][]byte{sps, pps, b}, time.Duration(p))
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user