improve fuzz tests (#591)

This commit is contained in:
Alessandro Ros
2024-08-01 11:56:52 +02:00
committed by GitHub
parent b160f5a614
commit e2d1e6dab4
56 changed files with 612 additions and 225 deletions

View File

@@ -37,3 +37,25 @@ func TestMPEG4VideoDecEncoder(t *testing.T) {
require.NoError(t, err)
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
}
func FuzzUnmarshalMPEG4Video(f *testing.F) {
f.Fuzz(func(
_ *testing.T,
a bool,
b string,
c bool,
d string,
) {
ma := map[string]string{}
if a {
ma["profile-level-id"] = b
}
if c {
ma["config"] = d
}
Unmarshal("audio", 96, "MP4V-ES/90000", ma) //nolint:errcheck
})
}