mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
improve fuzz tests (#591)
This commit is contained in:
@@ -33,3 +33,31 @@ func TestAV1DecEncoder(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
||||
}
|
||||
|
||||
func FuzzUnmarshalAV1(f *testing.F) {
|
||||
f.Fuzz(func(
|
||||
_ *testing.T,
|
||||
a bool,
|
||||
b string,
|
||||
c bool,
|
||||
d string,
|
||||
e bool,
|
||||
f string,
|
||||
) {
|
||||
ma := map[string]string{}
|
||||
|
||||
if a {
|
||||
ma["level-idx"] = b
|
||||
}
|
||||
|
||||
if c {
|
||||
ma["profile"] = d
|
||||
}
|
||||
|
||||
if e {
|
||||
ma["tier"] = f
|
||||
}
|
||||
|
||||
Unmarshal("video", 96, "AV1/90000", ma) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user