diff --git a/pkg/playlist/media_test.go b/pkg/playlist/media_test.go index 4c85a2d..16fec6c 100644 --- a/pkg/playlist/media_test.go +++ b/pkg/playlist/media_test.go @@ -318,6 +318,9 @@ func FuzzMediaUnmarshal(f *testing.F) { f.Fuzz(func(_ *testing.T, a string) { var m Media - m.Unmarshal([]byte(a)) //nolint:errcheck + err := m.Unmarshal([]byte(a)) + if err == nil { + m.Marshal() //nolint:errcheck + } }) } diff --git a/pkg/playlist/multivariant_test.go b/pkg/playlist/multivariant_test.go index 459e73e..4f63a51 100644 --- a/pkg/playlist/multivariant_test.go +++ b/pkg/playlist/multivariant_test.go @@ -879,6 +879,9 @@ func FuzzMultivariantUnmarshal(f *testing.F) { f.Fuzz(func(_ *testing.T, a string) { var m Multivariant - m.Unmarshal([]byte(a)) //nolint:errcheck + err := m.Unmarshal([]byte(a)) + if err == nil { + m.Marshal() //nolint:errcheck + } }) } diff --git a/pkg/playlist/playlist.go b/pkg/playlist/playlist.go index d0fcca4..dd37a53 100644 --- a/pkg/playlist/playlist.go +++ b/pkg/playlist/playlist.go @@ -13,8 +13,10 @@ const ( // Playlist is either Media or Multivariant. type Playlist interface { - isPlaylist() Unmarshal([]byte) error + Marshal() ([]byte, error) + + isPlaylist() } func findType(buf []byte) (Playlist, error) { diff --git a/pkg/playlist/playlist_test.go b/pkg/playlist/playlist_test.go index 073d907..df9b950 100644 --- a/pkg/playlist/playlist_test.go +++ b/pkg/playlist/playlist_test.go @@ -34,6 +34,9 @@ func FuzzPlaylistUnmarshal(f *testing.F) { } f.Fuzz(func(_ *testing.T, a string) { - Unmarshal([]byte(a)) //nolint:errcheck + pl, err := Unmarshal([]byte(a)) + if err == nil { + pl.Marshal() //nolint:errcheck + } }) }