mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
prevent decoding SDPs without media streams (#769)
This commit is contained in:
@@ -768,12 +768,21 @@ func FuzzSessionUnmarshal(f *testing.F) {
|
||||
"a=rtpmap:101 ulpfec/8000\r\n" +
|
||||
"a=mid:4\r\n")
|
||||
|
||||
f.Fuzz(func(_ *testing.T, enc string) {
|
||||
f.Fuzz(func(t *testing.T, enc string) {
|
||||
var sd sdp.SessionDescription
|
||||
err := sd.Unmarshal([]byte(enc))
|
||||
if err == nil {
|
||||
var desc Session
|
||||
desc.Unmarshal(&sd) //nolint:errcheck
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var desc Session
|
||||
err = desc.Unmarshal(&sd)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
require.NotZero(t, len(desc.Medias))
|
||||
|
||||
desc.Marshal(false) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user