mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 23:02:45 +08:00
improve fuzz tests (#591)
This commit is contained in:
@@ -33,3 +33,31 @@ func TestAV1DecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalAV1(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
e bool,
|
||||||
|
f string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["level-idx"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["profile"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if e {
|
||||||
|
ma["tier"] = f
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("video", 96, "AV1/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -1123,187 +1123,4 @@ func TestUnmarshalErrors(t *testing.T) {
|
|||||||
_, err := Unmarshal("video", 96, "", map[string]string{})
|
_, err := Unmarshal("video", 96, "", map[string]string{})
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("mpeg-4 audio generic", func(t *testing.T) {
|
|
||||||
_, err := Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"streamtype": "10",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"mode": "asd",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"profile-level-id": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"config": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"config": "0ab2",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"sizelength": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"indexlength": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"indexdeltalength": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"profile-level-id": "1",
|
|
||||||
"sizelength": "13",
|
|
||||||
"indexlength": "3",
|
|
||||||
"indexdeltalength": "3",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("audio", 96, "MPEG4-generic/48000/2", map[string]string{
|
|
||||||
"profile-level-id": "1",
|
|
||||||
"config": "1190",
|
|
||||||
"indexlength": "3",
|
|
||||||
"indexdeltalength": "3",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("mpeg-4 audio latm", func(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{
|
|
||||||
"cpresent": "0",
|
|
||||||
})
|
|
||||||
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{
|
|
||||||
"profile-level-id": "15",
|
|
||||||
"object": "2",
|
|
||||||
"cpresent": "0",
|
|
||||||
"sbr-enabled": "1",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
})
|
|
||||||
|
|
||||||
t.Run("av1", func(t *testing.T) {
|
|
||||||
_, err := Unmarshal("video", 96, "AV1/90000", map[string]string{
|
|
||||||
"level-idx": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("video", 96, "AV1/90000", map[string]string{
|
|
||||||
"profile": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
|
|
||||||
_, err = Unmarshal("video", 96, "AV1/90000", map[string]string{
|
|
||||||
"tier": "aaa",
|
|
||||||
})
|
|
||||||
require.Error(t, err)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalH264(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, sps string, pktMode string) {
|
|
||||||
Unmarshal("video", 96, "H264/90000", map[string]string{ //nolint:errcheck
|
|
||||||
"sprop-parameter-sets": sps,
|
|
||||||
"packetization-mode": pktMode,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalH265(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a, b, c, d string) {
|
|
||||||
Unmarshal("video", 96, "H265/90000", map[string]string{ //nolint:errcheck
|
|
||||||
"sprop-vps": a,
|
|
||||||
"sprop-sps": b,
|
|
||||||
"sprop-pps": c,
|
|
||||||
"sprop-max-don-diff": d,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalLPCM(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a string) {
|
|
||||||
Unmarshal("audio", 96, "L16/"+a, nil) //nolint:errcheck
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalMPEG4Video(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a, b string) {
|
|
||||||
Unmarshal("video", 96, "MP4V-ES/90000", map[string]string{ //nolint:errcheck
|
|
||||||
"profile-level-id": a,
|
|
||||||
"config": b,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalOpus(f *testing.F) {
|
|
||||||
f.Add("48000/a")
|
|
||||||
|
|
||||||
f.Fuzz(func(_ *testing.T, a string) {
|
|
||||||
Unmarshal("audio", 96, "Opus/"+a, nil) //nolint:errcheck
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalOpusMulti(f *testing.F) {
|
|
||||||
f.Add("48000/a")
|
|
||||||
|
|
||||||
f.Fuzz(func(_ *testing.T, a string) {
|
|
||||||
Unmarshal("audio", 96, "multiopus/"+a, nil) //nolint:errcheck
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalVorbis(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a, b string) {
|
|
||||||
Unmarshal("audio", 96, "Vorbis/"+a, map[string]string{ //nolint:errcheck
|
|
||||||
"configuration": b,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalVP8(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a, b string) {
|
|
||||||
Unmarshal("video", 96, "VP8/90000", map[string]string{ //nolint:errcheck
|
|
||||||
"max-fr": a,
|
|
||||||
"max-fs": b,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func FuzzUnmarshalVP9(f *testing.F) {
|
|
||||||
f.Fuzz(func(_ *testing.T, a, b, c string) {
|
|
||||||
Unmarshal("video", 96, "VP9/90000", map[string]string{ //nolint:errcheck
|
|
||||||
"max-fr": a,
|
|
||||||
"max-fs": b,
|
|
||||||
"profile-id": c,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
@@ -61,3 +61,25 @@ func TestH264DecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalH264(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["sprop-parameter-sets"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["packetization-mode"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("video", 96, "H264/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -70,3 +70,33 @@ func TestH265DecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalH265(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["sprop-vps"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["sprop-sps"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["sprop-pps"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["sprop-max-don-diff"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("video", 96, "H265/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -41,3 +41,9 @@ func TestLPCMDecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalLPCM(f *testing.F) {
|
||||||
|
f.Fuzz(func(_ *testing.T, a string) {
|
||||||
|
Unmarshal("audio", 96, "L16/"+a, nil) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -124,3 +124,107 @@ func TestMPEG4AudioDecEncoder(t *testing.T) {
|
|||||||
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalMPEG4AudioGeneric(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
e bool,
|
||||||
|
f string,
|
||||||
|
g bool,
|
||||||
|
h string,
|
||||||
|
i bool,
|
||||||
|
j string,
|
||||||
|
k bool,
|
||||||
|
l string,
|
||||||
|
m bool,
|
||||||
|
n string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["streamtype"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["mode"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if e {
|
||||||
|
ma["profile-level-id"] = f
|
||||||
|
}
|
||||||
|
|
||||||
|
if g {
|
||||||
|
ma["config"] = h
|
||||||
|
}
|
||||||
|
|
||||||
|
if i {
|
||||||
|
ma["sizelength"] = j
|
||||||
|
}
|
||||||
|
|
||||||
|
if k {
|
||||||
|
ma["indexlength"] = l
|
||||||
|
}
|
||||||
|
|
||||||
|
if m {
|
||||||
|
ma["indexdeltalength"] = n
|
||||||
|
}
|
||||||
|
|
||||||
|
fo, err := Unmarshal("audio", 96, "MPEG4-generic/48000/2", ma) //nolint:errcheck
|
||||||
|
if err == nil {
|
||||||
|
fo.(*MPEG4Audio).GetConfig()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalMPEG4AudioLATM(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
e bool,
|
||||||
|
f string,
|
||||||
|
g bool,
|
||||||
|
h string,
|
||||||
|
i bool,
|
||||||
|
j string,
|
||||||
|
k bool,
|
||||||
|
l string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["profile-level-id"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["bitrate"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if e {
|
||||||
|
ma["cpresent"] = f
|
||||||
|
}
|
||||||
|
|
||||||
|
if g {
|
||||||
|
ma["config"] = h
|
||||||
|
}
|
||||||
|
|
||||||
|
if i {
|
||||||
|
ma["object"] = j
|
||||||
|
}
|
||||||
|
|
||||||
|
if k {
|
||||||
|
ma["sbr-enabled"] = l
|
||||||
|
}
|
||||||
|
|
||||||
|
fo, err := Unmarshal("audio", 96, "MP4A-LATM/48000/2", ma) //nolint:errcheck
|
||||||
|
if err == nil {
|
||||||
|
fo.(*MPEG4Audio).GetConfig()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -37,3 +37,25 @@ func TestMPEG4VideoDecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalMPEG4Video(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["profile-level-id"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["config"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("audio", 96, "MP4V-ES/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -34,3 +34,19 @@ func TestOpusDecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalOpus(f *testing.F) {
|
||||||
|
f.Add("48000/a")
|
||||||
|
|
||||||
|
f.Fuzz(func(_ *testing.T, a string) {
|
||||||
|
Unmarshal("audio", 96, "Opus/"+a, nil) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalOpusMulti(f *testing.F) {
|
||||||
|
f.Add("48000/a")
|
||||||
|
|
||||||
|
f.Fuzz(func(_ *testing.T, a string) {
|
||||||
|
Unmarshal("audio", 96, "multiopus/"+a, nil) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/1125f325323e9fc7
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/1125f325323e9fc7
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string(" \x17T\x9b")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/b00e47b24d2e9cb9
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/b00e47b24d2e9cb9
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("7XXB")
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/eebf8f9815961809
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalAV1/eebf8f9815961809
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
@@ -1,4 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
string("")
|
string("")
|
||||||
|
bool(true)
|
||||||
string("")
|
string("")
|
||||||
string("0")
|
|
5
pkg/format/testdata/fuzz/FuzzUnmarshalH264/5075dbc90b7b6a98
vendored
Normal file
5
pkg/format/testdata/fuzz/FuzzUnmarshalH264/5075dbc90b7b6a98
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("1,")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("0,")
|
|
||||||
string("0")
|
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
string(",0")
|
string(",0")
|
||||||
|
bool(true)
|
||||||
string("0")
|
string("0")
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string(",")
|
|
||||||
string("0")
|
|
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/2daed44edfbf6eb6
vendored
Normal file
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/2daed44edfbf6eb6
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("6")
|
||||||
|
bool(true)
|
||||||
|
string("\v\xd7F?O\xc1\x86\t")
|
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/33e4616183c38258
vendored
Normal file
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/33e4616183c38258
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("\xd9\xf3fdž\xd7\xf6\x1d6")
|
||||||
|
bool(true)
|
||||||
|
string("\v\xd7F?O\xc1\x86\t")
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("0")
|
|
||||||
string("0")
|
|
||||||
string("")
|
|
||||||
string("0")
|
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
string("")
|
string("")
|
||||||
string("")
|
bool(true)
|
||||||
string("0")
|
|
||||||
string("")
|
string("")
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
string("0")
|
string("0")
|
||||||
|
bool(false)
|
||||||
string("")
|
string("")
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("0")
|
|
||||||
string("\x00")
|
|
||||||
string("")
|
|
||||||
string("0\xa5")
|
|
@@ -1,5 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("0")
|
|
||||||
string("A")
|
|
||||||
string("\xb3\xbd\xcf\xf4\x10\xa6")
|
|
||||||
string("")
|
|
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/c7ec2102ba02e189
vendored
Normal file
5
pkg/format/testdata/fuzz/FuzzUnmarshalH265/c7ec2102ba02e189
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("6")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/20a4b86e7f3eb21a
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/20a4b86e7f3eb21a
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/27784d49f1893338
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/27784d49f1893338
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/2bb30ba1c4453253
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/2bb30ba1c4453253
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("wB\xaa(A\x0e}")
|
||||||
|
bool(true)
|
||||||
|
string("\xe4o\xe0^\xae\t")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("D")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/476ec3e9138c8eb5
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/476ec3e9138c8eb5
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/4af8a7dd6093eb24
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/4af8a7dd6093eb24
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/5d992b86416286cb
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/5d992b86416286cb
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("u7\xae")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/731691b15fbea80a
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/731691b15fbea80a
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/8b4ed3e41f9c83a2
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/8b4ed3e41f9c83a2
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/bfe2ad2a3698abb3
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/bfe2ad2a3698abb3
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/d8485f52680b1799
vendored
Normal file
15
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioGeneric/d8485f52680b1799
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
||||||
|
bool(true)
|
||||||
|
string("1010")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/1257c728665a4688
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/1257c728665a4688
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/2fb2d97e2adc8960
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/2fb2d97e2adc8960
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/3553983aa018ca4e
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/3553983aa018ca4e
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/4b1485d4a1427dc3
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/4b1485d4a1427dc3
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/75b3662d71eadc76
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/75b3662d71eadc76
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/760672708ba53010
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/760672708ba53010
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f08cb14faaf3bac7
vendored
Normal file
13
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4AudioLATM/f08cb14faaf3bac7
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
||||||
|
bool(false)
|
||||||
|
string("0")
|
||||||
|
bool(true)
|
||||||
|
string("70002010")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
@@ -1,4 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
string("")
|
string("")
|
||||||
|
bool(true)
|
||||||
string("")
|
string("")
|
||||||
string("1")
|
|
5
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/6eb4ff7048b704f4
vendored
Normal file
5
pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4Video/6eb4ff7048b704f4
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
string("0")
|
bool(false)
|
||||||
string("")
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("0")
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("0")
|
|
||||||
string("0")
|
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("A")
|
|
||||||
string("")
|
|
@@ -1,5 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
string("")
|
bool(true)
|
||||||
string("")
|
|
||||||
string("")
|
|
||||||
string("A")
|
string("A")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
@@ -1,3 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("A")
|
|
||||||
string("")
|
|
@@ -1,3 +1,5 @@
|
|||||||
go test fuzz v1
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
string("0")
|
string("0")
|
||||||
|
bool(true)
|
||||||
string("")
|
string("")
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/24b8bd12666dcd48
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/24b8bd12666dcd48
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
@@ -1,4 +0,0 @@
|
|||||||
go test fuzz v1
|
|
||||||
string("1")
|
|
||||||
string("")
|
|
||||||
string("#")
|
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/a108f706bad26777
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/a108f706bad26777
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/be47706b29845dac
vendored
Normal file
7
pkg/format/testdata/fuzz/FuzzUnmarshalVP9/be47706b29845dac
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test fuzz v1
|
||||||
|
bool(true)
|
||||||
|
string("")
|
||||||
|
bool(false)
|
||||||
|
string("")
|
||||||
|
bool(true)
|
||||||
|
string("")
|
@@ -18,3 +18,11 @@ func TestVorbisAttributes(t *testing.T) {
|
|||||||
require.Equal(t, 48000, format.ClockRate())
|
require.Equal(t, 48000, format.ClockRate())
|
||||||
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
|
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalVorbis(f *testing.F) {
|
||||||
|
f.Fuzz(func(_ *testing.T, a, b string) {
|
||||||
|
Unmarshal("audio", 96, "Vorbis/"+a, map[string]string{ //nolint:errcheck
|
||||||
|
"configuration": b,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -33,3 +33,25 @@ func TestVP8DecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalVP8(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["max-fr"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["max-fs"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("audio", 96, "VP8/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -33,3 +33,31 @@ func TestVP9DecEncoder(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34}, byts)
|
require.Equal(t, []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34}, byts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FuzzUnmarshalVP9(f *testing.F) {
|
||||||
|
f.Fuzz(func(
|
||||||
|
_ *testing.T,
|
||||||
|
a bool,
|
||||||
|
b string,
|
||||||
|
c bool,
|
||||||
|
d string,
|
||||||
|
e bool,
|
||||||
|
f string,
|
||||||
|
) {
|
||||||
|
ma := map[string]string{}
|
||||||
|
|
||||||
|
if a {
|
||||||
|
ma["max-fr"] = b
|
||||||
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
ma["max-fs"] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
if e {
|
||||||
|
ma["profile-id"] = f
|
||||||
|
}
|
||||||
|
|
||||||
|
Unmarshal("audio", 96, "VP9/90000", ma) //nolint:errcheck
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user