mirror of
https://github.com/aler9/gortsplib
synced 2025-10-07 08:01:14 +08:00
improve MPEG4AudioLATM (#251)
This commit is contained in:
@@ -711,6 +711,59 @@ func TestUnmarshalMPEG4AudioGenericErrors(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestUnmarshalMPEG4AudioLATMErrors(t *testing.T) {
|
||||
_, err := Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"profile-level-id": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"bitrate": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"object": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"object": "120",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"cpresent": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"config": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"sbr-enabled": "aaa",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"profile-level-id": "15",
|
||||
"cpresent": "0",
|
||||
"config": "400026103fc0",
|
||||
"sbr-enabled": "1",
|
||||
})
|
||||
require.Error(t, err)
|
||||
|
||||
_, err = Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"profile-level-id": "15",
|
||||
"object": "2",
|
||||
"cpresent": "0",
|
||||
"sbr-enabled": "1",
|
||||
})
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func FuzzUnmarshalH264(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, sps string, pktMode string) {
|
||||
Unmarshal("video", 96, "H264/90000", map[string]string{
|
||||
@@ -737,19 +790,6 @@ func FuzzUnmarshalLPCM(f *testing.F) {
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzUnmarshalMPEG4AudioLATM(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, a, b, c, d, e, f string) {
|
||||
Unmarshal("audio", 96, "MP4A-LATM/48000/2", map[string]string{
|
||||
"profile-level-id": a,
|
||||
"bitrate": b,
|
||||
"object": c,
|
||||
"cpresent": d,
|
||||
"config": e,
|
||||
"sbr-enabled": f,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzUnmarshalMPEG4VideoES(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, a, b string) {
|
||||
Unmarshal("video", 96, "MP4V-ES/90000", map[string]string{
|
||||
|
Reference in New Issue
Block a user