improve MPEG4AudioLATM (#251)

This commit is contained in:
Alessandro Ros
2023-04-15 13:04:16 +02:00
committed by GitHub
parent 03013f1a87
commit f5aedf9b7f
6 changed files with 65 additions and 44 deletions

View File

@@ -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{