mirror of
https://github.com/aler9/gortsplib
synced 2025-10-10 09:30:11 +08:00
ensure unmarshaled entities can be marshaled back (#773)
This commit is contained in:
@@ -160,11 +160,14 @@ func FuzzResponseUnmarshal(f *testing.F) {
|
||||
f.Add(ca.byts)
|
||||
}
|
||||
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
var res Response
|
||||
err := res.Unmarshal(bufio.NewReader(bytes.NewBuffer(b)))
|
||||
if err == nil {
|
||||
res.Marshal() //nolint:errcheck
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = res.Marshal()
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user